Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Updating code

Status
Not open for further replies.

smGhouse

Civil/Environmental
Aug 16, 2007
4
0
0
US
Hi,
I have written a VBA code and it works perfectly fine untill I insert an entire row to the exisitng sheet. The code doesn't work for that new cell I have inserted but works fine for other cells. Any suggestion are apprecited.
Thanks
Ghouse
 
Replies continue below

Recommended for you

Can you show us the code? I assume that this an excel issue. Also, you may want to put this in the VBA forum. You may get a better response.
 
This is the code to highlight the cell and make the font bold if checkbox is checked.

Private Sub CheckBox1_Click()
Range("C5").Select

Do Until Selection.Offset(1, 0).Value = ""
Selection.Offset(1, 0).Select

If CheckBox1 = True Then
If Selection.Value = Range("I5") Then
With Selection.Font
.ColorIndex = 3
.Bold = True
End With
End If
Else
Selection.Font.ColorIndex = 0
Selection.Font.Bold = False
End If
Loop
Range("C3").Select
End Sub

Would you provide me the link to VBA forum.
Thanks
Ghouse

 
I tried to recreate your problem but couldn't. Where are you inserting the new row? The macro begins reading cells in column C starting at C6 looking for a match to I5, and quits after encountering a blank cell.
 
Status
Not open for further replies.
Back
Top