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

Monika,

How about

Set myRange = Range(range1,range2)
Application.CutCopyMode = False
Selection.AutoFill Destination:=myRange,Type:=xlFillDefault
myRange.Select

--

HTH

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

"monika" wrote in message
...
no..say column AK heading is "package" and column AO heading is "Pins".

I will find add as :
set range1 = cells.find("Package")
set range2 = cells.find("Pins")

now i know from which column to start. say its range1.column

now i want to replace....Range("AK73:AO102") as:

range(range1.column & lnewrng.row & ":" & range2.column & lastcellnum)

i tried a few combinations like this ... .which didn't work.

I hope i am clear

thanks
Monika
"Frank Kabel" wrote in message
...
Hi Monika
try
Range("AK73:AO" & last_row_var)


--
Regards
Frank Kabel
Frankfurt, Germany

monika wrote:
hi...

i want to replace Range("AK73:AO102") ...proper address so as to
remove the hardcoding. i know the lastcell number of my sheet . but
how do i replace the above with proper using '&' ... i tried but it
doesn't work !

Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("AK73:AO102"),
Type:=xlFillDefault Range("AK73:AO102").Select

thanks
monika