View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How to refer a name in VBA


Dim S as String
S="A2:A500"

and then use:
Range(S)

you can accomplish the same thing by using a Defined Name from the worksheet.
--
Gary''s Student - gsnu200793


"clara" wrote:

Hi all,

the following is my current code:
For Each t In Sheets("Tasks").Range("A2:A500")

I'd like to define a name refer to ("A2:A500") and use that name in the
above code, how can I do it.

Clara
--
thank you so much for your help