View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default select cell by variable name

What doesn't work with that line?

Do you have a range named "var_name" ?

How did you name it?

Works for me in Excel 2003

Try these for testing only.

Sub test()
Range("A10").Select
Selection.Name = "var_name"
Range("A9").Select
Selection.Resize(4).EntireRow.Insert
End Sub

Sub test2()
Range("var_name").Select
msgbox selection.address
End Sub


Gord Dibben MS Excel MVP

On Tue, 20 May 2008 11:02:17 -0700, Adam wrote:

I tried Range("var_name").Select but that does not work.