VBA in MS 365 not running on Windows 10 version

normpam

Active Member
Joined
Oct 30, 2002
Messages
354
When I run my program which includes the following code on my Office 365 version it works just fine. Does not work on any version with Windows 10 or Windows 7. When run on the other computers it errors out and highlights in yellow the code below that is in red font.

Was there an update which 'canceled' this code syntax, and if so, what can be used that will work on a non-Office 365 version?

Program code:
customer = Range(ActiveCell, ActiveCell).Value
Range("P2").CurrentRegion.Name = "CustList"
Range("CustList").Select
Selection.Find(What:=customer, After:=ActiveCell, LookIn:=xlFormulas2, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Remove the '2' of 'xlFormulas2' …​
You must see the VBA example of Range.Find method for how to check if something is found​
as your code as it is (from Macro Recorder and not cleaned) obviously raises an error when nothing is matching …​
 
Upvote 0
Thanks much! Seems to work ( I also turned on the Developer option in ribbons - not sure if that had something to do with it. Anyway, how do you guys get to know this stuff?!
 
Upvote 0
Just using classic Excel versions - nothin' to do in fact with Windows 10 or Seven ! - where this VBA constant does not exist …​
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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