Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is probably very simple but I can't figure it out. I have button
activated relative reference macros that fill hours worked, total hours for the day, etc. on time cards. The user selects the first cell of a particular day (correct cell highlighted in yellow) and then the button for the shift that he worked that day. Nothing fancy. The problem is that I don't want the macro to run unless the correct, yellow-highlighted cell is selected. If the user selects an incorrect cell and then attempts to run the macro, I want the macro to end without running and possibly give the user an error message box. The message box isn't mandatory as long as the macro doesn't run. I've tried if/then statements based on the active cell but can't get it to work. Any suggestions? This is a simplified version of my typical macro; after it fills cells, the cursor returns to the first cell, which would be my "starting-point" yellow cell. ActiveCell.FormulaR1C1 = "'0700" ActiveCell.Offset (0, 1).Range("A1").Select ActiveCell.FormulaR1C1 = "1500" ActiveCell.Offset (0, 1).Range("A1").Select ActiveCell.FormulaR1C1 = "8" ActiveCell.Offset (0, -2).Range("A1").Select End Sub Thanks for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro relative cell reference | Excel Worksheet Functions | |||
Relative reference? in macro | Excel Worksheet Functions | |||
Using relative reference in macro | Excel Discussion (Misc queries) | |||
Macro to copy text to a specific cell reference | Excel Programming | |||
MACRO Relative Reference | Excel Programming |