Hi all! I hope someone can help me out with this macro. I'm new to VBA and I'm really struggling. I'm obviously not a
developer of any kind, but I am trying to help out my local Fire Department with this time sheet workbook. Here's what I'm
trying to do.
I have a workbook that has a separate sheet for each month Jan-Dec, labeled as such. Across the top
of each are my dates (1-31), and down column A are the categories for our time reporting (i.e., Training, Meetings, Duty,
etc.). I also have 2 extra sheets for data about 2 of our categories (I'll explain this in a minute).
Now, for 2
of our categories I need to get a little more detail on what they did. So when a user enters their hours for that day under
one of these categories (like C16), I need to prompt the user for a brief text description of the work. This description
will be required if they enter 'any' time under this category, so if they hit OK I need to save this information and if they
hit CANCEL or don't enter a description, they should not be allowed to enter time. Once they hit OK with a description
entered in the box, I need to take that description and place that text in one of those extra sheets I spoke of, along with
the date where they entered the time (from my column header), and the hours they entered. I just need to place this
information in this extra sheet row by row, just to track it. When I place this data in the extra sheet, I'd like to be able
to find the next blank row, copy the date in Col A, Description from InputBox in Col B, and the hours in Col C. Then make
sure it goes back to the original Monthly sheet the user was entering into. These extra sheets will be locked to the users,
it's only for my reporting purposes. I have tried several things, and have come to a "sticking" point.
Here's the code I have thus far, but I receive errors on the Range line (Range("B1").Select) and I don't know
enough about VBA to understand the problem:
'Run macro TrainingDesc when cell is changed
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("C16:AG19")) Is Nothing Then TrainingDesc
'TrainingDesc Input Macro to build database list
TrgDesc = InputBox("Please enter a description for the training.", "Training Description")
Sheets("Category E Data").Select
If IsEmpty(ActiveCell) = False Then
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TrgDesc
I have yet to add the Date and Hours to the extra sheet too. I haven't gotten that far. For the
life of me I have been pulling my hair out on this one just to get the InputBox data saved. It's probably a real simple fix,
but I just can't see it. Any help is greatly appreciated!!! Thank you!