In my sheet I have attached, I am runnnig a for each loop. I want the macro to run through the sheet and call a series of sub-routines for each hotel listed. What I want to happen is to run all my hotels that have "Friday" selected with one macro.
I have a For each cell in the hotel information table set up. I want that to find all the instance of Friday for example, then run a series of subs for that Friday, then move on to the next Friday.
The subs import the files listed in colums k-p, so I also need to figure out how to action those. My idea was to start a variable that would tell me which row was highlighted and then open the files, but if there is a simpler way, I'm open to it.
I really just need the basic outline for the loop, I have all the sub-routines finished in another version of this where I setup which hotel from the table I want to run the reporting on. This is all standardized, so I figured out I can actually run all these on my coffee break if I can crack through this. Any help is appreciated.
I have this started, but it is a nightmare.
Sub TEST()
Dim Locale As Range
Dim W As Integer
Range("NumberDOW").Select
W = Range("NumberDOW").Value
Range("DOWNumb").Select
For Each cell In Range("DOWNumb")
If cell.Value = W Then GoTo RunMacros:
'If cell.Value <> W Then GoTo Message:
ActiveCell.Range = Locale
RunMacros:
MsgBox "You are at the RunMacro label."
If cell.Value = 1 Then GoTo Monday:
If cell.Value = 2 Then GoTo Tuesday:
If cell.Value = 3 Then GoTo Wednesday:
If cell.Value = 4 Then GoTo Thursday:
If cell.Value = 5 Then GoTo Friday:
Monday:
Call GetFilePathDailyD
Locale = 0
Tuesday:
Call GetFilePathDailyD
Locale = 0
Message:
MsgBox "You have no reports to run today."
Next cell
End Sub
Bookmarks