ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help writing a macro please! (https://www.excelbanter.com/excel-programming/414885-help-writing-macro-please.html)

mcarter

help writing a macro please!
 
I need help writing a macro.
I have a worksheet of columns A - D, with 100 rows.
I need to hide the row if the value in column C is 0.
I can get the macro started in row 1 of column C by recording
a macro and selecting that cell, but from there I don't know
what to do. Thanks soooooo much!

FSt1

help writing a macro please!
 
hi
Sub mcarter()
Dim r As Range
Dim rd As Range
Set r = Range("c1")
Do While Not IsEmpty(r)
Set rd = r.Offset(1, 0)
If r.Value = 0 Then
r.EntireRow.Hidden = True
End If
Set r = rd
Loop
MsgBox "done"
End Sub


"mcarter" wrote:

I need help writing a macro.
I have a worksheet of columns A - D, with 100 rows.
I need to hide the row if the value in column C is 0.
I can get the macro started in row 1 of column C by recording
a macro and selecting that cell, but from there I don't know
what to do. Thanks soooooo much!



All times are GMT +1. The time now is 07:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com