Results 1 to 2 of 2

Variables to multiple cells on multiple sheets

Threaded View

  1. #1
    Registered User
    Join Date
    05-06-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    2

    Exclamation Variables to multiple cells on multiple sheets

    I am a novice VBA programmer.

    So far I have successfully created macros that move data from cell to variable and from variable to cell on a sheet.
    I did this by doing something like this:
    Range("f5").Select
    actual_gwg(0) = Range("f5").Value
    'to assign a variable a cells value
    
    Range("r5").Select
    Range("r5").Value = monthly_gwg(0)
    'to assign a cell the value of a variable
    Now I need to move data from sheet1 to sheets 2-9
    All the data I need to move is saved to variables.

    If I ran the code with the select line uncommented I get an Unable to get the selct property of the range class error
    so I commented it out

    Here is where the insanity part comes in.
    Going through the code it works perfectly for the first variable I am assigning to a sheet2
    The second variable I try to assign to a cell on sheet3 and I get an error object missing.
    Here is the code:
    'Sheet2.Range("b4").Select
    Sheet2.Range("b4").Value = Barnegat_Yesterday_New_Goal
    'Sheet3.Range("b4").Select
    Sheet3.Range("b4").Value = Bridgeton_Yesterday_New_Goal
    Here is a Screen Shot:
    code.gif

    Please help... I'd have this all done by now if I wasn't getting this error!
    Thank you so much for your time in helping me in anyway possible.

    I am a novice VBA programmer.

    So far I have successfully created macros that move data from cell to variable and from variable to cell on a sheet.
    I did this by doing something like this:
    Range("f5").Select
    actual_gwg(0) = Range("f5").Value
    'to assign a variable a cells value
    
    Range("r5").Select
    Range("r5").Value = monthly_gwg(0)
    'to assign a cell the value of a variable
    Now I need to move data from sheet1 to sheets 2-9
    All the data I need to move is saved to variables.

    If I ran the code with the select line uncommented I get an Unable to get the selct property of the range class error
    so I commented it out

    Here is where the insanity part comes in.
    Going through the code it works perfectly for the first variable I am assigning to a sheet2
    The second variable I try to assign to a cell on sheet3 and I get an error object missing.
    Here is the code:
    'Sheet2.Range("b4").Select
    Sheet2.Range("b4").Value = Barnegat_Yesterday_New_Goal
    'Sheet3.Range("b4").Select
    Sheet3.Range("b4").Value = Bridgeton_Yesterday_New_Goal
    Here is a Screen Shot:
    code.gif

    Please help... I'd have this all done by now if I wasn't getting this error!
    Thank you so much for your time in helping me in anyway possible.
    Attached Images Attached Images
    Last edited by davesexcel; 05-06-2012 at 05:05 PM. Reason: Duplicate

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1