Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've included a portion of a Do loop below. It works (no Run Type Error 13,
Type Mismatch) for x = 1 but fails for x =2. The mismatch occurs on loop #2 with this statement highlighted: Range("$B$1").Value = Cells(Range("$H$4").Value + x, "D").Value The H4 cell contains a valid row number which was 270 for loop 1 and is now 271 for loop 2. The totalnumberofsessions value is 4. Here are the Watch values at time of the failu Watch : : Range("$B$1").Value : 7/4/2009 11:24:44 PM : Variant/Date : Module18.ChartSessions Watch : : Range("$H$4").Value : 269 : Variant/Double : Module18.ChartSessions Watch : : Range("$H$4").Value + x : 271 : Variant/Double : Module18.ChartSessions Watch : : x : 2 : Integer : Module18.ChartSessions I would appreciate someone letting me know what I am doing wrong and how I can get this to work. Thanks and have a good day. Jim ' Cycle through all the sessions to process and print charts for each individual session Dim x As Integer Dim totalnumberofsessions As Integer totalnumberofsessions = Range("$F$4") x = 1 Do While x <= totalnumberofsessions Range("$B$1").Value = Cells(Range("$H$4").Value + x, "D").Value Range("$C$2").Value = Cells(Range("$H$4").Value + x, "F").Value *** working code here ************** x = x + 1 Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
DoWhile Loop & Type mismatch error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Help - Type mismatch when running loop with strings from arrays | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming | |||
Code works 1st time then Type Mismatch when checking for not blank cells | Excel Programming |