Join and Excel97

Belair58

Board Regular
Joined
Mar 31, 2005
Messages
95
Hi,

I'm using the e-mail function from Lotus Notes (Thanks for the code) but I a couple of users that are still using 97 and the code blows up at the following command.
Code:
MailDoc.Body = _ 
    Replace("The following NEW SUPPLIER request had been actioned today:@@" _ 
        & Join(Application.Transpose(Range([a1], [a300].End(3))), "@") _ 
            & "@@...", "@", vbCrLf)
To be exact, right at the Join command. Is there code I could use to accomplish this same task without using the Join command?

As always your help is greatly appreciated.

Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
belair.

you could use a loop to accomplish this without the join function. you would have to do this before the line you are referencing though. something along these lines (not error-tested):

Code:
   Dim MyJoinString as String
   Dim MyArray() as String

'  Load range into array for quicker processing
   MyArray = Range([a1], [a300].End(3))
   MyJoinString = ""

   For i = LBound(MyArray) to UBound(MyArray)
'     Combine strings using concatenate and seperator "@"
      MyJoinString = MyJoinString & MyArray(i, 1) & "@"
   Next i

'  Strip extra "@" from the end
   MyJoinString = Left(MyJoinString, Len(MyJoinString) - 1)

MailDoc.Body = _ 
    Replace("The following NEW SUPPLIER request had been actioned today:@@" _ 
        & MyJoinString & "@@...", "@", vbCrLf)
to replace
Code:
MailDoc.Body = _ 
    Replace("The following NEW SUPPLIER request had been actioned today:@@" _ 
        & Join(Application.Transpose(Range([a1], [a300].End(3))), "@") _ 
            & "@@...", "@", vbCrLf)
hope this helps. ben.
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,447
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top