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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

sweater_vests_rock

Well-known Member
Joined
Oct 8, 2004
Messages
1,657
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,195,662
Messages
6,010,999
Members
441,579
Latest member
satishrazdhan

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
Top