bobkap
Active Member
- Joined
- Nov 22, 2009
- Messages
- 323
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
In the code below, I'm trying to find the NUMBER of the column where "coursecol" is located. Presently, my formula returns a text string such as "BLS Class". But, so I can use coursecol in a Vlookup which would identify the column number, I need the number of the cell location as we use when we do something like Cells(4,18). I want to know what the 18, in this case, is for my text string. Any help would be greatly appreciated.
counter2 = 1
finalrow2 = (Sheets("Payrates").Cells(Rows.Count, finalcol3).End(xlUp).Row)
For counter2 = counter2 To finalrow2
If (Worksheets("Payrates").Cells(inputrow5, inputcol5).Value = coursename) Then
coursecol = (Worksheets("Payrates").Cells(inputrow5, inputcol5).Value)
Exit For
End If
inputcol5 = inputcol5 + 1
Next counter2
counter2 = 1
finalrow2 = (Sheets("Payrates").Cells(Rows.Count, finalcol3).End(xlUp).Row)
For counter2 = counter2 To finalrow2
If (Worksheets("Payrates").Cells(inputrow5, inputcol5).Value = coursename) Then
coursecol = (Worksheets("Payrates").Cells(inputrow5, inputcol5).Value)
Exit For
End If
inputcol5 = inputcol5 + 1
Next counter2