Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looking for advice on a "best practice" with Excel VBA:
I have a spreadsheet for customer master data records with about 30 columns. I have some simple userforms that enable the user to add/edit/ view records from the worksheet with the master data. The user does not have access to the master data worksheet as I need to force the data they enter to go through several validations prior to writing/ updating a record. Right now to add/update a record (and fill in fields on the userform) I have the column numbers hardcoded via public constants. Works great for now...but, if in the future I want to add a column (say, insert a country column after state), my column numbers will get "out-of- whack". What would be the best way to keep the spreadsheet and code dynamic in terms of adding future columns (in between existing columns)? Should I just, as an initialization event, search for the heading (e.g. "phone") for each column and then assign the column numbers to global variables? Do I just stick a bunch of "future use" columns in the spreadsheet? Any guidance would be appreciated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete all duplicate records - without keeping one of them | Excel Worksheet Functions | |||
Offset code for dynamic row# & multiple columns in LINEST function | Excel Worksheet Functions | |||
Adding columns w/new formulas BUT keeping subtotals | Excel Discussion (Misc queries) | |||
Preventing duplicates when adding records to list | Excel Programming | |||
Pivot table: Adding dynamic columns | Excel Programming |