View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to specify a range in Excel macro

Eric,

Just noticed that you said variable columns, but your example showed
variable rows. If it should be rows, try

Range("A1").Resize(Cells(Rows.Count,"A").End(xlUp) .Row,1).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Eric,.

Range("A1").Resize(1, Cells(1,
Columns.Count).End(xlToLeft).Column).Select


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Eric" wrote in message
...
Hi,

How could I select a range in macro if I don't know how
many columns I have, meaning my columns is variable.

Example: Range("A1:A4").select

Need help.

TIA
Eric