Hi all-
This code was given to me a couple of days ago from a nice guy by the name of Al.
Private Sub CommandButton6_Click()
Dim lastrow As Long, x As Long
Dim matchday As Integer, matchcol As Integer
Dim myarr(1 To 7)
matchday = WorksheetFunction.Match(Format(Date, "dddd"), Rows("1:1"), 0)
lastrow = Cells(Rows.Count, "bt").End(xlUp).Row
For x = 2 To lastrow
matchcol = Cells(x, "cb").End(xlToLeft).Column
If matchcol <> matchday Then GoTo E
MsgBox Cells(x, 72) & " gets paid today."
E:
Next x
It all works great! However in the few days Ive decided That I would like to use textboxes that list the employee's names instead of a msgbox. The textboxes are on a userform that pops up when a user clicks on a commandbutton. Heres the clincher:
How do you rearange the code so that when the userform pops up, all the names are listed at once? I will have 10 textboxes on the userform. Using a msgbox can be annoying, especialy when it has to go though 6 or 7 names. Any ideas?
This code was given to me a couple of days ago from a nice guy by the name of Al.
Private Sub CommandButton6_Click()
Dim lastrow As Long, x As Long
Dim matchday As Integer, matchcol As Integer
Dim myarr(1 To 7)
matchday = WorksheetFunction.Match(Format(Date, "dddd"), Rows("1:1"), 0)
lastrow = Cells(Rows.Count, "bt").End(xlUp).Row
For x = 2 To lastrow
matchcol = Cells(x, "cb").End(xlToLeft).Column
If matchcol <> matchday Then GoTo E
MsgBox Cells(x, 72) & " gets paid today."
E:
Next x
It all works great! However in the few days Ive decided That I would like to use textboxes that list the employee's names instead of a msgbox. The textboxes are on a userform that pops up when a user clicks on a commandbutton. Heres the clincher:
How do you rearange the code so that when the userform pops up, all the names are listed at once? I will have 10 textboxes on the userform. Using a msgbox can be annoying, especialy when it has to go though 6 or 7 names. Any ideas?