Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tara
 
Posts: n/a
Default How to create a routine

I would like to have a routine that would put data (an X) in cells at the
start of a day, so that as I then check the item each day and update the
contents of other cells, I can remove the X? It would only do this at the
start of a new day. The worksheet might be opened several different times.
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I bet you could do something like this. But what happens when you get
interrupted and have to start over. If your routine actually keeps track, you
may not be able to reset your data.

How about an alternative. Just have a macro that you can run on demand. Run it
whenever you want (usually the first time you open the workbook that day).

Say your X's go in column A starting in Row 2 and continues until you run out of
data in column B.

You could use something like:

Option Explicit
Sub AddXs()

Dim wks As Worksheet
Dim FirstRow As Long
Dim LastRow As Long

Set wks = Worksheets("Sheet1")

With wks
FirstRow = 2
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row

.Range(.Cells(FirstRow, "A"), .Cells(LastRow, "A")).Value = "X"
End With

End Sub

Then you could run it by:
tools|macro|macros|select the name of the macro (AddXs)
click run



Tara wrote:

I would like to have a routine that would put data (an X) in cells at the
start of a day, so that as I then check the item each day and update the
contents of other cells, I can remove the X? It would only do this at the
start of a new day. The worksheet might be opened several different times.


--

Dave Peterson
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
Create a tabular control rkg Excel Discussion (Misc queries) 0 August 8th 05 09:25 PM
How do you create a complicated pivot table graph? Natalia Kozyura Charts and Charting in Excel 1 April 7th 05 02:52 AM
Can't create dynamic charts Brian Sells Charts and Charting in Excel 7 March 22nd 05 04:23 AM
Template in Excel prettytwin1 New Users to Excel 1 March 9th 05 09:22 PM
Use Julian Date To Create Serial Number antho10359 Excel Discussion (Misc queries) 4 December 9th 04 01:50 AM


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