Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Module

Status
Not open for further replies.

TSO456

Technical User
Jul 23, 2001
57
US
Dim Sht As Worksheet
Dim FirstRow As Integer, LastRow As Integer
Dim App, Itm
Dim SendTo As String, Esubject As String, Ebody As String
Dim Attachment1 As String
Dim Attachment2 As String

Set Sht = Worksheets("Sheet1")

FirstRow = 2
LastRow = 5000 ' You could insert code here to find last row
For x = FirstRow To LastRow
SendTo = Sht.Range("D" & x).Value
If Len(SendTo) > 0 Then ' Make sure there is data in this row
Esubject = Sht.Range("E" & x).Value
Ebody =


The above is part of the code that I use to email from EXCEL. The only problem is that in the (Ebody=) part I am limited to certain numbers of characters. How can I expand the capacity of the (Ebody=) so I can add more characters.

Thanks
Jill
 
Hi Jill,
I'm obviously not understanding your problem here. If I wished to add to Ebody as in your example I would code:

FirstRow = 2
LastRow = 10 ' You could insert code here to find last row
For x = FirstRow To LastRow
SendTo = Sht.Range("D" & x).Value
If Len(SendTo) > 0 Then ' Make sure there is data in this row
Esubject = Sht.Range("E" & x).Value
End If
Ebody = Ebody & Sht.Range("F" & x).Value
Next

which would add to the variable each time the For statement was executed. Or are you saying that you have hit a maximum size for the amount for text that can go in a variable?

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top