Look at the Bold code I've added - it should help you. When there is no match, "nothing" gets found, and that's the basic problem here. This will help handle the no-label-found issue - although I may have the End If statements in slightly
wrong place(s) - I'll leave it to you to determine what to do when there is a match and when there isn't one.
Dim FoundLabel As Range
Dim FoundCell2 As Range
Do While 1
'get the next variable name
thisBookCol = ActiveCell.Address
thisBookCol = Right(thisBookCol, Len(thisBookCol) - 1)
thisBookCol = Left(thisBookCol, InStr(thisBookCol, "$") - 1)
findName = Range(thisBookCol + "1")
'Find the variable column position and copy to template
Windows(str_fileName).Activate
ActiveSheet.Range("B2").Select
Selection.Copy
Windows(thisBook).Activate
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows(str_fileName).Activate
Columns("A:A").Select
'note that I removed .Select from the end of the next statement
Set FoundLabel = Selection.Find(What:="TimeStamp", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
'On Error Resume Next
If Not FoundLabel Is Nothing Then
FoundCell.Select ' so it becomes the ActiveCell
labelnamerow = **** ActiveCell.Row
Rows(labelnamerow).Select
Set FoundCell2 = Selection.Find(What:=findName, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False) ' .Activate deleted!
If Not FoundCell2 Is Nothing Then
FoundCell.Select ' so it can become the ActiveCell for the rest of your code here
currPos = Right(ActiveCell **** .Address, Len(ActiveCell.Address) - 1) 'Remove first $
colRef = Left(currPos, InStr(currPos, "$") - 1)
'Range(colRef & 38).Select
Range(colRef & (labelnamerow + 2)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows(thisBook).Activate
Range(thisBookCol + "2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If ' end test for FoundCell2 is nothing
ActiveCell.Offset(-1, 1).Select
End If ' end test for FoundCell is Nothing
'Check to see if this was the last variable required
If thisBookCol = maxCol Then
Exit Do
End If
Loop