LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Not cycling through each sheet

This code is not working for me...I want to cycle through each sheet in
my workbook and run and IF statement. It is not cycling through my
sheets, please help! TIA! - mike


Range("A1").Select
Selection.End(xlDown).Select
Dim TodaysDate
TodaysDate = ActiveCell.Text

Dim WbMain As Workbook
Dim wb As Workbook
Dim Sh As Worksheet

Application.ScreenUpdating = False
Application.EnableEvents = False

Set WbMain = ActiveWorkbook
For Each Sh In WbMain.Worksheets
Range("A1").Select
Selection.End(xlDown).Select
If ActiveCell.Value = TodaysDate Then
Range("A1").End(xlDown).Offset(1, 0).FormulaR1C1 = "=today()"
Range("A1").End(xlDown).Offset(0, 1).Formula = "0"
Columns("A:A").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Range("A1").Select
End If
Next Sh




*** Sent via Developersdex http://www.developersdex.com ***
 
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
Tab keeps cycling through the same row Mike Excel Discussion (Misc queries) 2 August 14th 08 12:20 AM
Cycling through workbooks Nico Excel Discussion (Misc queries) 4 July 4th 08 10:09 PM
cycling through columns? Kirk Excel Programming 2 May 2nd 05 07:51 PM
Cycling through variables. Azza Excel Programming 1 October 14th 04 10:23 PM
Cycling through worksheets Chris Gorham[_3_] Excel Programming 2 November 5th 03 08:37 PM


All times are GMT +1. The time now is 09:45 AM.

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"