[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Copy routine with Variables

Asked by ddball1 in Microsoft Excel Spreadsheet Software, Spreadsheet Software

Tags: Excel VBA 2003

Sometimes I feel so dumb.  I am self teaching myself this and I keep getting this Run time 1004 error with this little routine.  The error occurs on this line:
Range(Cells(5, doug - 2)).Select
All I am trying to do is copy the text from one location to another on the same worksheet but location of the orginal text will change therefore I need a variable.   I actually have the variable identified in the macro that this routine will be placed in.  Therfore to make it easy I just id it in this routine.
1:
2:
3:
4:
5:
6:
7:
8:
Dim doug As Long
    doug = 11
    
    Range(Cells(5, doug - 2)).Select
    Selection.Copy
    Range(Cells(2, 1)).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
[+][-]11/03/09 09:20 AM, ID: 25731215Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 09:21 AM, ID: 25731223Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 09:24 AM, ID: 25731259Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 12:46 PM, ID: 25733410Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625