Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I use the record macro from the drop down menu to select multiple
non-continguous blocks of cells to copy/paste, I get code like this: Range("B13:B34,D13:D34,I13:I34").Select Range("I13").Activate Selection.Copy Range("S13").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False I tried to duplicate the above in vb using this: Dim fmcv As Worksheet Dim topbot As Worksheet ' every other variable below undefined explicitly were defined as Long fmcv.Activate Range(Range(Cells(fmcvRowStart, fmcvSecidCol), Cells(fmcvRowEnd, fmcvSecidCol)), _ Range(Cells(fmcvRowStart, fmcvIssuerCol), Cells(fmcvRowEnd, fmcvIssuerCol)), _ Range(Cells(fmcvRowStart, fmcvPctPortfolioCol), Cells(fmcvRowEnd, fmcvPctPortfolioCol))).Select Selection.Copy topbot.Activate Cells(topbot1stRow, topbotTickerCol).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False But the above is givng me a "compile error: wrong # of arguments or invalid property assignment" at the first instance of the word 'range'. Question: is it actually possible to accomplish what I want and, if so, how? Thanks a lot. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
automatically selecting contiguous cells - Why? | New Users to Excel | |||
selecting non-contiguous cells | Excel Discussion (Misc queries) | |||
Stop selecting blocks of cells | New Users to Excel | |||
Selecting a contiguous row of cells | Excel Discussion (Misc queries) | |||
Printing non contiguous blocks | Excel Programming |