Greetings and felicitudes,
I am new to both my job and VB and I'm trying to automate a few tasks around the office. I run excel 97. I've put together a script from parts of posts from your archive and the macro recorder.
Here is what my script is intended to do:
I have a type of spreadsheet with 11 columns and a variable number of rows. I want every row containing a cell with the value 0 (this doesn't include blanks) in either column D or Column I (or both) moved to a second blank worksheet and the cells shifted up.
This is what I came up with up on my own. (It isn't complete)
Sub Zeroremover()
Dim cell As Range
Dim aRange As Range
Set aRange = Range(Range("I1"), Range("I65536").End(xlUp))
For Each cell In aRange
If cell.Value <> "0" Then
cell.EntireRow.Hidden = True
End If
Next cell
aRange.SpecialCells(xlCellTypeVisible).EntireRow.Copy
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub
Any help would be greatly appreciated!
Steve
I am new to both my job and VB and I'm trying to automate a few tasks around the office. I run excel 97. I've put together a script from parts of posts from your archive and the macro recorder.
Here is what my script is intended to do:
I have a type of spreadsheet with 11 columns and a variable number of rows. I want every row containing a cell with the value 0 (this doesn't include blanks) in either column D or Column I (or both) moved to a second blank worksheet and the cells shifted up.
This is what I came up with up on my own. (It isn't complete)
Sub Zeroremover()
Dim cell As Range
Dim aRange As Range
Set aRange = Range(Range("I1"), Range("I65536").End(xlUp))
For Each cell In aRange
If cell.Value <> "0" Then
cell.EntireRow.Hidden = True
End If
Next cell
aRange.SpecialCells(xlCellTypeVisible).EntireRow.Copy
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End Sub
Any help would be greatly appreciated!
Steve