ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reviewing a list of defined named ranges (https://www.excelbanter.com/excel-programming/371000-reviewing-list-defined-named-ranges.html)

Barb Reinhardt

Reviewing a list of defined named ranges
 
I have the following snippet of code

For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
Set REF = Cells(i, "a")
Application.Goto Reference:=REF
Exit Sub
MsgBox ("Displaying " & Cells(i, "A"))
Next i

It's not going to the reference. What do I need to change?

Thanks,

Don Guillett

Reviewing a list of defined named ranges
 
try removing Exit sub
or simpler??
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
MsgBox ("Displaying " & Cells(i, "A"))
Next i


--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
I have the following snippet of code

For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
Set REF = Cells(i, "a")
Application.Goto Reference:=REF
Exit Sub
MsgBox ("Displaying " & Cells(i, "A"))
Next i

It's not going to the reference. What do I need to change?

Thanks,




Barb Reinhardt

Reviewing a list of defined named ranges
 
Oops, I should have removed the EXIT SUB. In column A, I have a named range.
I want to step through them one by one to view them. How do I do that?

Thanks

"Don Guillett" wrote:

try removing Exit sub
or simpler??
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
MsgBox ("Displaying " & Cells(i, "A"))
Next i


--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
I have the following snippet of code

For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
Set REF = Cells(i, "a")
Application.Goto Reference:=REF
Exit Sub
MsgBox ("Displaying " & Cells(i, "A"))
Next i

It's not going to the reference. What do I need to change?

Thanks,





Don Guillett

Reviewing a list of defined named ranges
 
Hi Barb,
Not necessary to select

Sub stepthru()
For Each c In Range("st")
'c.Select 'uncomment if you really want to goto that cell
MsgBox "showing " & c
Next c
End Sub

--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
Oops, I should have removed the EXIT SUB. In column A, I have a named
range.
I want to step through them one by one to view them. How do I do that?

Thanks

"Don Guillett" wrote:

try removing Exit sub
or simpler??
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
MsgBox ("Displaying " & Cells(i, "A"))
Next i


--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in
message
...
I have the following snippet of code

For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
Set REF = Cells(i, "a")
Application.Goto Reference:=REF
Exit Sub
MsgBox ("Displaying " & Cells(i, "A"))
Next i

It's not going to the reference. What do I need to change?

Thanks,








All times are GMT +1. The time now is 12:44 AM.

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