ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   selecting multiple objects with macro (https://www.excelbanter.com/excel-discussion-misc-queries/212196-selecting-multiple-objects-macro.html)

Memphus01

selecting multiple objects with macro
 
I have a spreadsheet where mutliple items are cut from a webpage and pasted
to an excel sheet. (this is done this way because I have not been able to
download the data using the import function since the data requires a web
based query to populate the page i cut from)

I have figured out how to create a macro that copies from a cell with a
value of 1 and then paste special multiple all the text i import to remove
those hyperlinks.

Anyway, as a result of this cut and paste job, I always end up with a few
hundred check boxes (with hyperlinks) that I would like to remove.

I can do this manually by using the select multiple objects button on the
drawing menu, but the object's names change each time. And therefore the
macro I recorded will not work more than once.

Is there a way to select all by type? (maybe I can select by name using a
"*" rather than the "ctlnumber" listed (below is an example of the names)?

"ctl00_ctl00_ctl00_Main_Main_Main_rptRatings_ctl14 _icoStatus", _
"ctl00_ctl00_ctl00_Main_Main_Main_rptRatings_ctl15 _icoStatus", _

my basic goal is to get this sheet back to plain text (with no drawings or
hyperlinks) to save space.

thanks in advance...

Gary''s Student

selecting multiple objects with macro
 
Give this a try:

Sub cleanup()
Cells.Hyperlinks.Delete
ActiveSheet.Pictures.Delete
End Sub
--
Gary''s Student - gsnu200817

Memphus01

selecting multiple objects with macro
 
that is just far too simple... :-) thanks!

"Gary''s Student" wrote:

Give this a try:

Sub cleanup()
Cells.Hyperlinks.Delete
ActiveSheet.Pictures.Delete
End Sub
--
Gary''s Student - gsnu200817


Gary''s Student

selecting multiple objects with macro
 
The first time I saw it, I was a little shocked myself.
--
Gary''s Student - gsnu200817


"Memphus01" wrote:

that is just far too simple... :-) thanks!

"Gary''s Student" wrote:

Give this a try:

Sub cleanup()
Cells.Hyperlinks.Delete
ActiveSheet.Pictures.Delete
End Sub
--
Gary''s Student - gsnu200817



All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com