Hi there,
I have the below bit of code. In my head, it should loop through columns 1 to 52 of row 8 of the spreadsheet assigned to cTeam, and return True if the value is like "tel".
The values in those cells are Contact Tel. Contact Tel. 2 Home Tel. Home Tel. 2 etc., but the Like operator keeps returning false - am I doing it wrong somehow? I've tried having it as "*Tel*" as well as what it is now, but it hasn't helped. I've stepped through all 52 iterations with F8 and it hasn't picked up any of the columns with the Tels
I have the below bit of code. In my head, it should loop through columns 1 to 52 of row 8 of the spreadsheet assigned to cTeam, and return True if the value is like "tel".
The values in those cells are Contact Tel. Contact Tel. 2 Home Tel. Home Tel. 2 etc., but the Like operator keeps returning false - am I doing it wrong somehow? I've tried having it as "*Tel*" as well as what it is now, but it hasn't helped. I've stepped through all 52 iterations with F8 and it hasn't picked up any of the columns with the Tels
Code:
With cTeam
For logCol = 1 To 52 Step 1
colLetter = Split(Cells(1, logCol).Address, "$")(1)
If Cells(8, logCol).Value Like "*" & "Tel" & "*" Then
cTeam.Range(colLetter & "8" & ":" & logCol).SpecialCells(xlCellTypeVisible).Copy
cSheet.Cells(1, cSheetCol).PasteSpecial Paste:=xlPasteValues
cSheetCol = cSheetCol + 1
End If
Next logCol
End With