help with VBA scipt to listen to sheet

R

RompStar

Ok, My Range for the data rows is:

rows 4 to 1001, (1 - 3 are header rows), after 1001 is not recorded,
people never go that far :- )

Basically my sheet in the Rows has different columns A through I

A: is skipped for formatting and background graphics,
B: has a date
C: drop-down list of all the Employees names
D: drop-down list for Activity (basically what they are doing to
account for time)
E: drop-down list with Activity Type
F: Count number (manual entry by user)
G: start time, user enter
H: End time, user enter

I: calculated the time total H-G and is not really used by the end
user.

So, what I am working on is to make the sheet easier to use for the end
users...

If the user picks: Absent from column D, then:

I would like the rest of the columns to prefill automatically and
figure out the avaialable hours used...

I was working with something like this, keep in mind that I am just a
beginner VBA programmer, I am still learning and reading...

Also, I would like for this VBA script to work, so that it listens to
user input in the worksheet, so that I don't have to play the script,
if they were to make a drop-down list choice in column D of Absent, the
rest of the stuff would pre-fill in that column, not all the columns,
just the ones that the user selected...

so :- )

--------------------------------------------------------

Sub IfAbsent_prefilltherest()

Dim Ash As Worksheet

' If column D in the AllValidation drop-list is equal to "Absent"
' then prefill columns E, F, G, H on the fly without playing this
script...

For Each cell In
Ash.Columns("D").Range("D4:D1001").Cells.SpecialCells(xlCellTypeAllValidation)

If cell.Value = "Absent" Then
ActiveSheet.Range("E4:E1001").Value = "N/A"
ActiveSheet.Range("F4:F1001").Value = ""
ActiveSheet.Range("G4:G1001").Value = "08:00 AM"
ActiveSheet.Range("H4:H1001").Value = "03:30 PM"

Else: GoTo Finish

End If

Finish:

End Sub
 
Top