Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I believe in most cases there is little difference between Cells and
UsedArrea. VBA wil not go outside the used area unless data on the worksheet at one time outside the used area that was deleted. That is simply not true. Yes, certain Excel functions and methods won't look outside of the UsedRange, but if you set up a loop to iterate all the cells on the worksheet, then VB will iterate all the cell on the worksheet (after all, how would it know you don't intend to do something with a cell currently not in the UsedRange).. Here is your code modified to maintain a counter (just to make sure you won't have to wait too long) and when the counter reaches 500, it will display the counter value and the cell it is currently at. Run this code on a blank sheet (UsedRange being nothing) and watch the cell value that is displayed... it will be a value outside of the UsedRange. Sub ChangeFriendly() Dim r As Range, Counter As Long, TextToDisplay As String For Each r In ActiveSheet.Cells ' ************** Start Added Code ************** Counter = Counter + 1 If Counter = 500 Then MsgBox Counter & " - " & r.Address Exit For End If ' ************** End Added Code ************** If r.Hyperlinks.Count 0 Then With r.Hyperlinks(1) TextToDisplay = .Address End With End If Next End Sub -- Rick (MVP - Excel) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy / Paste Hyperlink, but not Formats | Excel Discussion (Misc queries) | |||
Hyperlink Copy & Paste | Excel Discussion (Misc queries) | |||
Copy picture and paste hyperlink | Excel Worksheet Functions | |||
Copy/Paste Hyperlink Address | Excel Discussion (Misc queries) | |||
hyperlink copy / paste | Excel Discussion (Misc queries) |