diamantebonita
New Member
- Joined
- May 25, 2011
- Messages
- 22
I basically copied this code out of the Excel 2010 Power Programming Guide, pg. 408, and changed it slightly to fit my needs.
list = ""
For r = 1 To 10
For c = 27 To 29
list = list & Cells(r, c).Text
If c <> 29 Then list = list & vbTab
Next c
list = list & vbCrLf
Next r
MsgBox list
The previous section of my code copies text to a separate area of the worksheet, and this section of code is supposed to display it as a list on a MsgBox that displays when the workbook is opened.
However every so often the list fails to display. The msgbox will pop up but it will simply be blank. I think it has something to do with the
'If c <> 29 Then list = list & vbTab' line
But I cant figure it out.
list = ""
For r = 1 To 10
For c = 27 To 29
list = list & Cells(r, c).Text
If c <> 29 Then list = list & vbTab
Next c
list = list & vbCrLf
Next r
MsgBox list
The previous section of my code copies text to a separate area of the worksheet, and this section of code is supposed to display it as a list on a MsgBox that displays when the workbook is opened.
However every so often the list fails to display. The msgbox will pop up but it will simply be blank. I think it has something to do with the
'If c <> 29 Then list = list & vbTab' line
But I cant figure it out.