Wrong text in msgbox

E

Ed

I run a routine to (among other things) delete certain cells. Tom Ogilvy
gave me code which is supposed to collect the values of the deleted cells in
the string "strTIR" (Dim'd at the beginning of the code) and display them in
a message box. The message box popped up this morning showing me "strTIR",
instead of the collected cell values! This make me think that, just
possibly, I may(?!?) have screwed up Tom's code. I have included the
pertinant parts of the code below. Any kicks in the proper direction are
appreciated.



Ed



' Runs routine to delete all file paths with ERROR msg

Range("AM1").Select

Selection.End(xlDown).Select



Do While ActiveCell.Value <> "Header"

If ActiveCell.Value = "" Then

ActiveCell.Offset(rowOffset:=-1, columnOffset:=0).Activate

Else: rngR = ActiveCell.Row

Range("AB" & rngR).Select



' add TIR No to string

strTIR = strTIR & ActiveCell.Value & vbNewLine



Selection.Delete Shift:=xlUp

Range("AM" & rngR).Select

ActiveCell.Offset(rowOffset:=-1, columnOffset:=0).Activate

End If

Loop



' Display TIRs deleted

MsgBox "Deleted TIRs:" & Chr(13) & "strTIR"
 
T

Tom Ogilvy

MsgBox "Deleted TIRs:" & Chr(13) & "strTIR"

should be

MsgBox "Deleted TIRs:" & Chr(13) & strTIR

Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top