View Single Post  Topic: Need Excel Help-Advanced 
Author Message
Rubberboots
Rubberbootsian


PostPosted: Tue Aug 08, 2006 1:59 am    Post subject: Reply with quote

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) Smile

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. Confused

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? Sad

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.
View toon's toonfile Send private message

Powered by phpBB © 2001, 2005 phpBB Group