named range in VBA failing

rjmdc

Well-known Member
Joined
Apr 29, 2020
Messages
693
Office Version
  1. 365
Platform
  1. Windows
did microsoft 365 make a change in using named ranges?
books that worked last week are all failing
how can i fix it?
Dim Smo As String: Smo = Format(Range("UIBilling_Month"), "m-yyyy")
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I use 365, and it works just fine for me.

Are you sure that you have a named range with name?
Are you sure that the range is exactly one cell in size?
Are you sure that the entry in that cell has been entered as a valid date, and not been entered as text instead?
 
Upvote 0
this book worked forever
i tink its an error in a new update that if VBA and Power query use the smae named range name it fails
 
Upvote 0
this book worked forever
i tink its an error in a new update that if VBA and Power query use the smae named range name it fails
I am not sure what you are saying.
Do you have two different ranges using the same name, perhaps on different sheets?

What is returned if you run this little procedure?
VBA Code:
Sub MyTest()
    MsgBox "Address of range is: " & Range("UIBilling_Month").Address
    MsgBox "Is range a date?: " & Application.WorksheetFunction.IsNumber(Range("UIBilling_Month"))
End Sub
 
Upvote 0
hi
this workbook worked till august 2024
seems like a new update in office 365 doesnt allow the same nme for a range to be used in both power querry and in VBA
i cannot get around it
 
Upvote 0
Do you mean you have a query in PQ with the same name as the named range?
 
Upvote 0
yes always ddi
every month i use the book to create billing
it worked as is from 2020 through July 2024
now it failed
it seems like a VBA update thats weird
 
Upvote 0
Can't you just rename one of them?
 
Upvote 0
seems like a new update in office 365 doesnt allow the same nme for a range to be used in both power querry and in VBA
Seems like it would be a good practice to use different names for different things.
Using the same name only invites unnecessary confusion/issues.
 
Upvote 0
too much code
i will need to roll back to a previous version of 365 until microsoft creates a fix
 
Upvote 0

Forum statistics

Threads
1,221,527
Messages
6,160,342
Members
451,638
Latest member
MyFlower

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