View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Macro to Run through each tab

Try the below

Sub Macro()
Dim ws As Worksheet, lngRow As Long
For Each ws In Sheets
For lngRow = ws.Cells(Rows.Count, "B").End(xlUp).Row To 1 Step -1
If ws.Range("B" & lngRow) = "" Then
ws.Rows(lngRow).Delete
Else
ws.Range("D" & lngRow) = ws.Range("B" & lngRow)
End If
Next
Next
End Sub

--
Jacob


"James8309" wrote:

Hi All,

I've been trying to figure out how to do this and am keep hitting to a
brick wall.

If anyone can help, that would be appreciated.


I have this excel workbook which has 15 tabs. What I am trying to do
is relatively simple

* Look at column B and if a cell in column B is empty then remove
entire row if a cell in column B is not empty then return the value in
column D in same row.

* Repeat the process from Tab 1 to Tab 15.


Thank you for your help in advance.


Happy New Year.


Regards,


James
.