Thread: Dynamic Range
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default Dynamic Range

Sheets("NATWEST").Select
Range(Cells(3,firstcol),Cells(3,lastCol)).Copy
Sheets("MTS TOTAL").Select
Range("C12").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"T De Villiers"
wrote in message
news:T.De.Villiers.2bv4rf_1154438407.9249@excelfor um-nospam.com...

The code below works fine but my range to copy is dynamic,
so that in the below ("K3:R3") could be ("M3:S3")
I have defined my first and last columns by firstcol and lastcol
respectively.
so that instead of ("K3:R3") I want something like
Range("(firstcol)3:(firstcol)3")

Many Thanks



Sheets("NATWEST").Select
Range("K3:R3").Copy
Sheets("MTS TOTAL").Select
Range("C12").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile:

http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=567018