Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
GPrabaka wrote:
I am running into a problem. I have the following code dim counter as integer counter = 0 Do While .ActiveCell.Offset(counter, 0).Value < "" If .ActiveCell.Offset(counter, 22).Value < "" Then .ActiveCell.EntireRow.Delete() End If counter = counter + 1 Loop If .ActiveCell.Offset(counter,22) is empty, which should be valid, it returns a fatal error "Cast from String "" to type 'Double' is not valid". I have tried formatting that column to text, currency etc. I still hit the same error. your code seems to be written in VB.NET. if so, try Do While Not IsNothing(.ActiveCell.Offset(counter, 0).Value) If Not IsNothing(.ActiveCell.Offset(counter, 22).Value) Then or Do While CStr(.ActiveCell.Offset(counter, 0).Value) < "" If CStr(.ActiveCell.Offset(counter, 22).Value) < "" Then -- HTH, okaizawa |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell changes to a formula after hitting ENTER | Excel Discussion (Misc queries) | |||
Linking 2 worksheets-Empty cell problem | Excel Discussion (Misc queries) | |||
problem of an empty cell | Excel Discussion (Misc queries) | |||
Problem Dropping data in first Empty Cell and across the row | Excel Programming | |||
automatically advance to next cell without hitting enter or tab | Excel Programming |