Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Macro to Run through each tab

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Macro to Run through each tab

Hi James,

Lets ensure I understand exactly what you want to do.

Test all cells in Column B (within the used range).
If a cell is empty then delete the row.
If the cell is not empty (this is what I don't understand.) Do you want to
copy the value in column D to column B or copy the value from B to column D.
(or something else altogether.)
Repeat the process from Tab 1 to Tab 15. (This is clear.)

--
Regards,

OssieMac


"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
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
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
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro to copy and paste values (columns)I have a macro file built C02C04 Excel Programming 2 May 2nd 08 01:51 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"