PDA

View Full Version : Solved: Copying values into range



DevanG
06-17-2011, 05:29 AM
My range is coming up null with this -- all the cells its equal to that i'm referencing have values.
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

Kenneth Hobs
06-17-2011, 05:37 AM
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.
?dbbook.Sheets(2).Range("Q" & (j + 1)).Value

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.

DevanG
06-17-2011, 05:58 AM
nvm... i just got my i's and j's mixed up.. sorry everyone! haha