View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default "relative reference"

Do you understand relative/absolute in terms of a worksheet cell reference?
If so, what exactly do you mean regarding recording a macro?

You can find the last row of a range like this

Set rng = Activesheet.UsedRange
iLastRow = rng(rng.Count).Row

Then you can set a range and for mat the whole range. For instance, this
gets all cells in column A

Set rngColA = Range("A1:A" & iLastRow)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"newarkj" wrote in message
...
I'm new to the whole macro thing and am looking for a simple way to
understand the "relative reference" when recording a macro. Can someone

shed
some light on that? also, my macro takes a spreadsheet of 10 columns and x
rows and formats it. How would I build the macro so that no matter the
number of rows, the macro will still work? would i have to write code for
this or will the record macro option work? Any advice would be

appreciated.
Thanks