If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Ecx

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-20-11, 13:26
codee240 codee240 is offline
Registered User
 
Join Date: May 2011
Posts: 19
Ecx

Dim CellRef As String


Windows("interim2.xls").Activate

CellRef = Sheets("Sheet1").Range("V3").Text

windows("interim2.xls").Activate
Range("BA1:BD1093").Select
Application.CutCopyMode = False
Selection.Copy

Windows(CellRef).Activate
Sheets("Sheet1").Select
Range("BA1:BA1093").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

ever time i run this code , the error 9 appears, don't seem to understand whats the problem.

any help would be life saving.
Reply With Quote
  #2 (permalink)  
Old 07-25-11, 11:03
apr pillai apr pillai is offline
Registered User
 
Join Date: Jan 2009
Location: Kerala, India
Posts: 107
The Paste Target Range: Range("BA1:BA1093").Select

Doesn't match with the Source Range: BA1:BD1093

You are trying to Copy Column Range BA...BD and pasting into Column BA... alone.

It will work if you replace the code for the Target Range as : Range("BA1").Select or Range("BA1:BD1093").Select
__________________
http://www.msaccesstips.com (Learn MS-Access Tips & Tricks)
Learn Advanced MS-Access Programming with sample VBA Code.

Last edited by apr pillai; 07-25-11 at 11:06.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On