Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default iValue Stops after 10 cells of data

I have a macro that looks up 14 cells of data and writes that data to 14
different worksheets in another spreadsheet.
I am using ivalue(xx) = .Range("J10") to retrieve the data in the cells
(with the xx being a 2 character variable to label the cell type, ie, AS, SG,
etc).
It works great until I get to the 11th variable. The 11th - 14th variables
return 0 as the value in the worksheet it is writing to. Will the iValue only
do up to 10 variables? If so, what can I do to get the addtional 4 I need?
Here is the code that gets and writes the iValue variable....it just repeats
14 times in the code. (Without the Dim line in the repeating code).

With wbData.Sheets(1)
iValueV = .Range("J12")
iValueAS = .Range("J11")
iValueSG = .Range("J10")
iValueCR = .Range("J13")
iValueCC = .Range("J14")
iValueCRate = .Range("J15")
iValueAVGS = .Range("J16")
iValueWP = .Range("J17")
iValueWPPS = .Range("J18")
OutRV = .Range("J19")
OutBSS = .Range("J20")
OutBMV = .Range("J21")
OutBIO = .Range("J22")
End With
' apply iValueV - Variance to matched row and column
With wbSum.Sheets(2)
Dim lastrow As Long, lastcol As Long, xV As Long, xR As Long, xC As Long
lastrow = .Cells(Rows.Count, 1).End(xlUp).Row
lastcol = .Cells(1, Columns.Count).End(xlToLeft).Column
'get matching row
For xV = 1 To lastrow
If iOffice = .Cells(xV, 1) Then xR = xV
Next xV
If xR = 0 Then MsgBox "Office: " & iOffice & " not found in summary Table"
' get matching column
For xV = 1 To lastcol
If iDate = .Cells(1, xV) Then xC = xV
Next xV
If xC = 0 Then MsgBox "Date: " & iDate & " not found in summary table"
If xR 0 And xC 0 Then .Cells(xR, xC) = iValueV
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default iValue Stops after 10 cells of data

Opps, the code is as below here...not like I first posted it!

"David" wrote:

I have a macro that looks up 14 cells of data and writes that data to 14
different worksheets in another spreadsheet.
I am using ivalue(xx) = .Range("J10") to retrieve the data in the cells
(with the xx being a 2 character variable to label the cell type, ie, AS, SG,
etc).
It works great until I get to the 11th variable. The 11th - 14th variables
return 0 as the value in the worksheet it is writing to. Will the iValue only
do up to 10 variables? If so, what can I do to get the addtional 4 I need?
Here is the code that gets and writes the iValue variable....it just repeats
14 times in the code. (Without the Dim line in the repeating code).

With wbData.Sheets(1)
iValueV = .Range("J12")
iValueAS = .Range("J11")
iValueSG = .Range("J10")
iValueCR = .Range("J13")
iValueCC = .Range("J14")
iValueCRate = .Range("J15")
iValueAVGS = .Range("J16")
iValueWP = .Range("J17")
iValueWPPS = .Range("J18")
iValueRV = .Range("J19")
iValueBSS = .Range("J20")
iValueBMV = .Range("J21")
iValueBIO = .Range("J22")
End With
' apply iValueV - Variance to matched row and column
With wbSum.Sheets(2)
Dim lastrow As Long, lastcol As Long, xV As Long, xR As Long, xC As Long
lastrow = .Cells(Rows.Count, 1).End(xlUp).Row
lastcol = .Cells(1, Columns.Count).End(xlToLeft).Column
'get matching row
For xV = 1 To lastrow
If iOffice = .Cells(xV, 1) Then xR = xV
Next xV
If xR = 0 Then MsgBox "Office: " & iOffice & " not found in summary Table"
' get matching column
For xV = 1 To lastcol
If iDate = .Cells(1, xV) Then xC = xV
Next xV
If xC = 0 Then MsgBox "Date: " & iDate & " not found in summary table"
If xR 0 And xC 0 Then .Cells(xR, xC) = iValueV
End With

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation in XL2007 suddenly stops functioning ker_01 Excel Discussion (Misc queries) 0 January 29th 10 11:58 PM
How do I select specific cells to be my tab stops? Tab Stops In Excel (JTurke) Excel Worksheet Functions 2 October 21st 08 05:58 AM
Area chart dives to zero when data series stops DannyS Charts and Charting in Excel 2 August 29th 07 11:10 AM
web query - stops at login to private data DianneZ Excel Discussion (Misc queries) 0 September 25th 06 10:42 PM
Going down until the data stops.... Darin Kramer Excel Programming 3 December 6th 04 04:55 PM


All times are GMT +1. The time now is 12:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"