LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
pm pm is offline
external usenet poster
 
Posts: 122
Default macro looping error

I have a spreadsheet that has 6 tabs and need to read the data in a specific
column (D) in each sheet...if the cell is not blank then store the data in a
new sheet....then go to next sheet and so on...i can't get my loop to
work....any suggestions?

This creates the new sheet:

Set NewSheet = Worksheets.Add
NewSheet.Name = "Echo"
Sheets("Echo").Select
Sheets("Echo").Move After:=Sheets("Store Ops")
Sheets("Apparel").Select

I want this to read data in each cell in column D for each sheet and if it's
not blank then write record to Echo sheet:

Sub RoundToZero()
For Each ws In Worksheets
dlr = Cells(Rows.Count, 1).End(xlUp).Row + 1
If ws.Name < ActiveSheet.Name Then
With ws
Cells(dlr, "d") = .Range("d2").Value
Next ws
End If
End Sub

This is the data i want to write to Echo sheet:

Sheets("Echo").Select
ActiveCell.FormulaR1C1 = "=MID(Janitorial!R[3]C[3],1,5)"
Sheets("Echo").Select
 
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
Looping Macro Jase Excel Discussion (Misc queries) 5 March 12th 08 09:08 PM
Macro looping endlessly Sandy Excel Worksheet Functions 6 May 10th 07 03:48 PM
Looping macro RK Excel Worksheet Functions 2 December 12th 06 11:29 PM
Looping a macro Sony Excel Discussion (Misc queries) 3 October 30th 06 11:52 AM
Macro looping problem. [email protected] Excel Discussion (Misc queries) 8 October 26th 06 02:44 PM


All times are GMT +1. The time now is 09:56 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"