Why can I delete text through VB but not if it is a number?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hennie Smit

    Why can I delete text through VB but not if it is a number?

    Apparently I must change the number in a cell to value before i can delete it

    Code:
    'Range is set from row 3 to end (Assumes row 1& 2 is column headers)
    With ActiveSheet
    Set rngColI = .Range(.Cells(3, "I"), _
    .Cells(.Rows.count, "I").End(xlUp))
    End With
    
    With rngColI
    'Must work backwards from bottom when deleting rows.
    For i = .Rows.count To 1 Step -1
    
    'Convert all cell to value to correspond with cboRegStock.Value
    
    varDeleteVal = Value
    
    If .Cells(i, 1) = varDeleteVal Then
    
    .Cells(i, 0).ClearContents
    .Cells(i, 1).ClearContents
    .Cells(i, 2).ClearContents
    .Cells(i, 3).ClearContents
  • smartchap
    New Member
    • Dec 2007
    • 236

    #2
    Dear Hennie
    Please make the problem clear. The code posted is part of some code and not clear about the problem being faced. What is the variable VALUE and what's its value?

    Comment

    Working...