B
Byers
I have a huge template I'm working on, but some columns don't get used
these get marked "N/A" in the 13th row. The columns range from D-EB..
making the total range D13:EB13. I've been trying to use macros tha
you've given to people asking for help on row issuses, but it's been
few hours so now I need help. I want it to search through that rang
of the sheet "staffing schedule" and find the first cell with "N/A" an
then delete every column from that cell to column EB.
This is the Macro I've created as trying to manipulate one you sen
out... it doesn't work, but it could be easier for you to just fix i
if it is somewhere close.
Sub Delete_Rows()
' This macro deletes all rows on the active worksheet
' that have Employee, Spouse, Child, or is blank in column A.
Sheets("Staffing Schedule").Select
Range("D13:EB13").Select
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "N/A" Then
Set del = Union(del, cell)
End If
Next
On Error Resume Next
del.EntireColumn.Delete
End Sub
This wasn't the only one I tried, there were a lot, like I said, I'v
been trying to teach myself Visual Basic for most of the day... pleas
help, it will take a huge burden off my back.
-Mar
these get marked "N/A" in the 13th row. The columns range from D-EB..
making the total range D13:EB13. I've been trying to use macros tha
you've given to people asking for help on row issuses, but it's been
few hours so now I need help. I want it to search through that rang
of the sheet "staffing schedule" and find the first cell with "N/A" an
then delete every column from that cell to column EB.
This is the Macro I've created as trying to manipulate one you sen
out... it doesn't work, but it could be easier for you to just fix i
if it is somewhere close.
Sub Delete_Rows()
' This macro deletes all rows on the active worksheet
' that have Employee, Spouse, Child, or is blank in column A.
Sheets("Staffing Schedule").Select
Range("D13:EB13").Select
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "N/A" Then
Set del = Union(del, cell)
End If
Next
On Error Resume Next
del.EntireColumn.Delete
End Sub
This wasn't the only one I tried, there were a lot, like I said, I'v
been trying to teach myself Visual Basic for most of the day... pleas
help, it will take a huge burden off my back.
-Mar