Rubberboots Rubberbootsian
|
Posted: Tue Aug 08, 2006 1:59 am Post subject: |
|
|
| chocoholic1415 : | um, why do you need to move to the cell to paste the info?
Range(varTarget).Select
ActiveSheet.Paste
can be replaced with:
Range(varTarget).Paste
No need to actually select the cell you want to paste to when you are using VBA.
also, if you want to paste something a certain distance from a given cell, the command you probably want to use is the offset command and/or the cells command. It's really late here and i'm not sure what the objective is. I'll check back in the morning or feel free to prill me. |
LoL, thanks a million! Exactly: Activecell.Offset(rows, cols)
About the pasting without "being there". Logically you should be able to do that but for some reason I cannot make it do that. It doesn't give me a logical error which I'd expect and intellisense uppercases the P but it does produce a runtime error.
| Quote: | Sub testme()
Range("b3").Select
Debug.Print Selection
Range("b1").Paste
End Sub |
The value, well text as I tested it, is properly loaded into memory and prints to the Immediate window but it crashes on line 3. Maybe I missed something?
Interestingly, and not really what I expected, if there is a formula in cell B3 (in this example) it returns the value of the formula and not the formula itself. |
|