HI all!
This is my very first post, so hopefully all information you need is here.
I keep getting a runtime error on the following highlighted in red.
Sub UpdateSubsChoosing()
'Runs through and replaces text "Sold Out" with the subs info from Subs Choosing sheet
Dim myRange As Range
Dim myCell As Range
If MsgBox("THIS WILL REPLACE EVERY " & "'" & "SOLD OUT" & "'" & " WITH THE SUBSTITUTION TEXT FROM THE " & vbCrLf & vbCrLf & _
"'" & "SUBS CHOOSING" & "'" & " Excel worksheet for the SPRING 2011 SEASON." & vbCrLf & vbCrLf & _
"DO YOU WANT TO CONTINUE?", vbYesNo, "REPLACING SOLD OUT WITH SUBS") = vbNo Then
Exit Sub
Else
Set myRange = Range("A1:AG500")
For Each cell In myRange
If Trim(UCase(cell.Value)) = "SOLD OUT" Then
cell.Font.FontStyle = Regular
cell.Value = "=IF(VLOOKUP(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2),'O:\Shipping\Forms, Slips, Labels, Charts\Subbing Forms\Subs Choosing & Tally Spring\[Subs Choosing Spring 2011.xlsm]Subs - MODIFY'!$A$1:$C$500,3,FALSE)=" & """" & """" & "," & """" & "S/O" & """" & ",VLOOKUP(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2),'O:\Shipping\Forms, Slips, Labels, Charts\Subbing Forms\Subs Choosing & Tally Spring\[Subs Choosing Spring 2011.xlsm]Subs - MODIFY'!$A$1:$C$500,3,FALSE))"
End If
Next cell
End If
End Sub
This is my very first post, so hopefully all information you need is here.
I keep getting a runtime error on the following highlighted in red.
Sub UpdateSubsChoosing()
'Runs through and replaces text "Sold Out" with the subs info from Subs Choosing sheet
Dim myRange As Range
Dim myCell As Range
If MsgBox("THIS WILL REPLACE EVERY " & "'" & "SOLD OUT" & "'" & " WITH THE SUBSTITUTION TEXT FROM THE " & vbCrLf & vbCrLf & _
"'" & "SUBS CHOOSING" & "'" & " Excel worksheet for the SPRING 2011 SEASON." & vbCrLf & vbCrLf & _
"DO YOU WANT TO CONTINUE?", vbYesNo, "REPLACING SOLD OUT WITH SUBS") = vbNo Then
Exit Sub
Else
Set myRange = Range("A1:AG500")
For Each cell In myRange
If Trim(UCase(cell.Value)) = "SOLD OUT" Then
cell.Font.FontStyle = Regular
cell.Value = "=IF(VLOOKUP(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2),'O:\Shipping\Forms, Slips, Labels, Charts\Subbing Forms\Subs Choosing & Tally Spring\[Subs Choosing Spring 2011.xlsm]Subs - MODIFY'!$A$1:$C$500,3,FALSE)=" & """" & """" & "," & """" & "S/O" & """" & ",VLOOKUP(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-2),'O:\Shipping\Forms, Slips, Labels, Charts\Subbing Forms\Subs Choosing & Tally Spring\[Subs Choosing Spring 2011.xlsm]Subs - MODIFY'!$A$1:$C$500,3,FALSE))"
End If
Next cell
End If
End Sub