VBA Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having trouble with the ALL CAPS section of the following code (clearly
I'm a VBA novice). Any help is appreciated:

Selection.copy
WORKBOOKS (FILENAME1).SHEETS("CURRENT LONG").RANGE("A4").SELECT
WORKBOOKS (FILENAME1).SHEETS("CURRENT LONG").ACTIVESHEET.PASTE
WORKBOOKS (FILENAME1).SHEETS("CURRENT LONG").APPLICATION.CUTCOPYMODE = FALSE

I don't make it past the second line -- it doesn't seem to like the 'select'
command. I previously defined FILENAME1 in my code and it is being
recognized.

Thanks
 
Adam,

I don't see a Select in any of your lines. But in the second all-cap line,
you have SHEETS("CURRENT LONG").ACTIVESHEET. It should be one or the other.
 
Sometimes Excel won't select anything if it is in another workbook, or it is
not the active sheet. Perhaps something like this.

With Application
.Goto Workbooks(FILENAME1).Sheets("CURRENT LONG").Range("A4")
ActiveSheet.Paste
.CutCopyMode = False
End With

It's easier to read if it's not in all Caps
HTH
Dana DeLouis
 
Adam,

If you want to select a range, that sheet has to be active.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top