Hello - Can anyone help with this one?
I have two files - data.xlsm and sched.xls.
The objective:
1) In data.xlsm, after hitting "GO", loop through column A. If you find a string that starts with "GB",
Do this:
2) Convert date which is next column over in data.xlsm to dd-mmm
3) Open sched.xls
4) Loop through first row until you find date (dd-mmm)
5) When you find date, loop through that column unitl string "POC" is found
6) When you find "POC", go to column A where you will find a name
7) Take the name and put it in data.xlsm.
Here is the code so far:
If something can point me in the right direction, I would really appreciate it.
Thanks
I have two files - data.xlsm and sched.xls.
The objective:
1) In data.xlsm, after hitting "GO", loop through column A. If you find a string that starts with "GB",
Do this:
2) Convert date which is next column over in data.xlsm to dd-mmm
3) Open sched.xls
4) Loop through first row until you find date (dd-mmm)
5) When you find date, loop through that column unitl string "POC" is found
6) When you find "POC", go to column A where you will find a name
7) Take the name and put it in data.xlsm.
Here is the code so far:
Code:
Dim dtLast As Date, strLMFile As String
Dim sched_dir As String, sched As String, sched_file As String
Dim LRow As Long, n As Long
Dim rCell As Range
Dim Rng As Range
Dim Rngbw As Range
Dim cel, cel_b As Range
Dim a, b, l As String
Dim cRow As Long, LastRow As Long
Dim i, j As Integer
Dim counter_1 As Integer
strFolder = "H:\"
strFile = dir("H:\sched.xls")
strLMFile = strFolder & strFile
Workbooks.Open (strLMFile)
Workbooks("data.xlsm").Activate
Worksheets("Sheet1").Select
With ThisWorkbook.Sheets("Sheet1")
Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
End With
For Each cel In Rng
If InStr(cel.Value, "GB") Then
a = cel.Offset(0, 1)
b = Format(a, ("dd-mmm"))
Workbooks("sched.xls").Activate
For Each cel_b In Range("A1:HZ1")
If cel_b.Value = b Then
End Sub
Thanks