G
GEdwards
I receive a Run-time Error '13': Type mismatch on the "MsgBox" statement
shown below. Before continuing with the use of the "sourceRange" I just want
to ensure
that I am picking up the correct data.
I am even wondering however if the line prior to the MsgBox, "Set
sourceRange..." is actually working.
Any suggestions to correct the type mismatch and display the actual values
within the source range?
Sub DisplayMat()
Dim sourceRange As Range
RowCount = 8
lastrow = Cells(Rows.Count, 3).End(xlUp).Row
If lastrow > 7 Then
For Each qty In Range("A8:A" & lastrow)
If qty <> "" Then
Set sourceRange = Range("A" & RowCount & ":" & "D" & RowCount)
MsgBox sourceRange 'I even tried "MsgBox sourceRange.value"
'Do more stuff here with the sourceRange and output to another WSheet
End If
RowCount = RowCount + 1
Next
End If
End Sub
shown below. Before continuing with the use of the "sourceRange" I just want
to ensure
that I am picking up the correct data.
I am even wondering however if the line prior to the MsgBox, "Set
sourceRange..." is actually working.
Any suggestions to correct the type mismatch and display the actual values
within the source range?
Sub DisplayMat()
Dim sourceRange As Range
RowCount = 8
lastrow = Cells(Rows.Count, 3).End(xlUp).Row
If lastrow > 7 Then
For Each qty In Range("A8:A" & lastrow)
If qty <> "" Then
Set sourceRange = Range("A" & RowCount & ":" & "D" & RowCount)
MsgBox sourceRange 'I even tried "MsgBox sourceRange.value"
'Do more stuff here with the sourceRange and output to another WSheet
End If
RowCount = RowCount + 1
Next
End If
End Sub