Link to home
Start Free TrialLog in
Avatar of John Smith
John SmithFlag for Australia

asked on

Macro not working on a 64 bit machine

Hello,

I have the following code that works perfectly on any 32 bit excel. However when someone tries it on a 64 bit version, they get an error message.

Does anyone know how to overcome this so that the code works on both machines?

Sub ReplaceLineBreaksInCell()
    Dim cel As Range
    For Each cel In Selection
        cel = Replace(cel, Chr(10), " ")
    Next
End Sub

Open in new window


Thank you!
Avatar of Harry Lee
Harry Lee
Flag of Canada image

I'm running Excel 2010 64bit on Windows 7 64bit, and I have no problem running the code.
What is the error message?
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Smith

ASKER

Very clever! that works. You were right too about the error message, I just had a look at the persons computer and that is exactly what was coming up.
Thank you for your help.