|
Forum home »
Delegate support and help forum »
Microsoft Access VBA Training and help » access course microsoft training - Chnaging range names
access course microsoft training - Chnaging range names
The UK's most regular instructor-led training courses.
Training information: access course microsoft training
· Microsoft.access.courses
· Microsoft Office VBA training Resolved · Low Priority · Version Standard
Chnaging range names
by - delegate Alex [3 posts] (2007 Oct 5 Fri, 10:47) Reply
I have range name which is used as the rowsource in a userform.
I want to be able to have the size of this range name be checked and changed when ever the form is called in order to ensure that only “live” rows are included in the list box selection.
The code I have written checks the size of the range using the excel row and match functions to find the start and end rows and should then define the range name size using these limits:
Dim FirstCountryRow As String
Dim LastCountryRow As String
Set FirstCountryRow = Row("Startcountrylist")
Set LastCountryRow = FirstCountryRow + (Match("[Spare]", "FullCountryList", 0) - 2)
ActiveWorkbook = "CountryList"
ActiveWorkbook.Names.Add Name:="TempCountryList", RefersToR1C1:="=CountryList!R4C1:R11C1"
However it’s not working and I’m having trouble debugging it so any help would be gratefully received.
RE: Chnaging range names
Hi Alex,
Our VBA trainers have had a look at this, and as this is quite complicated, would recommend coming on to our Access VBA course or arrange a one-to-one consultancy or tailored training.
Contact our enquiries team for more information.
Regards, Rich
|