Consulting

Results 1 to 3 of 3

Thread: Solved: Copying values into range

  1. #1
    VBAX Regular
    Joined
    Jun 2011
    Posts
    28
    Location

    Solved: Copying values into range

    My range is coming up null with this -- all the cells its equal to that i'm referencing have values.
    [VBA]Workbooks(Name).Sheets(1).Range("M" & (i + 4)).Value = dbbook.Sheets(2).Range("Q" & (j + 1)).Value + dbbook.Sheets(2).Range("R" & (j + 1)).Value + dbbook.Sheets(2).Range("S" & (j + 1)).Value[/VBA]

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Use debug to see the values or type a ? in the immediate window, paste the parts on the right side for each value, and press enter to see the value for each.
    e.g.
    [VBA]?dbbook.Sheets(2).Range("Q" & (j + 1)).Value[/VBA]

    I would not recommend using Name as the variable for the left side's workbook name. Use a prefix character like wName. Reserved keyword names should not be used outside of their scope in other words.

    Of course this means that you should have dbbook open to get their values and the workbook on the left side is open.

  3. #3
    VBAX Regular
    Joined
    Jun 2011
    Posts
    28
    Location
    nvm... i just got my i's and j's mixed up.. sorry everyone! haha

Posting Permissions

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