range

  • Thread starter Thread starter monika
  • Start date Start date
M

monika

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
 
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
 
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)
 
but what about my row and lastcell num...
i am starting this particular thing from row 73 .. till the lastcellnum....
 
I assume that you used those in creating range1 and range2.

--

HTH

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