View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] michael.tupper@gmail.com is offline
external usenet poster
 
Posts: 4
Default my first macro - super simple for any veteran... helpappreciated!

Awesome, Don, Thanks.

On Feb 2, 10:02 pm, "Don Guillett" wrote:
sub fillitup()
lr=cells(rows.count,"g").end(xlup).row
Range("G2").AutoFill Destination:=Range("G2:G" & lr)
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

Since I dont have ANY experience programming (yet), I am limited to
creating macros by only recording them.


So, I recorded my first Macro, everything works great! But it only
works perfectly on the sheet I created it with and not on any other of
the same type, as intended. The issue is simple, the recorded macro
inserted a fixed range as shown he


Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G289")
Range("G2:G289").Select


I simply must be able to replace the specified 'G289' in this case
with a variable associated to the row count in the Column G. I have
tried Help File, Googling for a while and just plain trying to learn
VBA programming on my own... but I have lost patience and am hoping
for a veteran to just tell me how to do it so I can get it done
finally!


Thanks in advance,
mtupper
VBA Rookie (future VBA junkie)