vba appears to insert a carriage return within certain text strings and hoses code

msteele f92

New Member
Joined
Mar 23, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
vba appears to insert a carriage return within certain text strings, this is hosing my code.

geo259 = "ABLA"
geo260 = "A LA"
geo261 = "A LA B"
geo262 = "la"
geo263 = "A"
geo264 = "L"
geo265 = "a"
geo266 = "l"

In break mode (note where the double quote occurs):
when i hover over geo259, 'geo259 =' appears
when i hover over geo260, 'geo260 ="A' appears
when i hover over geo261, 'geo261 ="A LA' appears (screen shot below)
when i hover over geo262, 'geo262 ="la"' appears
when i hover over geo263, 'geo263 ="A"' appears
when i hover over geo264, 'geo264 ="L"' appears
when i hover over geo265, 'geo265 ="a"' appears
when i hover over geo266, 'geo266 ="l"' appears

it appears all these text values write correctly if i write the string to cells within the worksheet .

any logic test with vba using values geo259, geo260, and geo261 cannot be relied on, which is smoking the process.

it looks to me like the string "LA" is causing an issue. poking around i found "LJ" and "LZ" behave similar. Other letter combinations beginning with "L" do not.

an associate cannot replicate this issue on his pc.

if i open and close excel, issue continues to occur.

it does not appear i am using a reserved string.

do i have to reset something somewhere?

Thanks all for any suggestions.
 

Attachments

  • LA.png
    LA.png
    9.5 KB · Views: 24
  • ALAB.png
    ALAB.png
    8.1 KB · Views: 24

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Your pics are postage stamp size so can't see much. If it's not a version issue or how the wb is being interacted with between you and anyone else, I don't have a clue. You might try Replace function, like
replace(geo259,chr(10),"")
 
Upvote 0
Micron thanks for taking a look. Good idea, sadly no luck. I tried similar much more involved approach which did not do the trick either. I reattached the postage stamps, maybe these are better look.
 

Attachments

  • ALAB.png
    ALAB.png
    33.1 KB · Views: 23
  • LA.png
    LA.png
    32.7 KB · Views: 20
Upvote 0
Pics are readable now. Cell value is what was assigned to the variable, so the problem is that the bubble help doesn't show the complete value? If that's it, I don't think I'd worry about it. I use it when it works and inquire in the immediate window when it doesn't.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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