I am totally new to VBA and Macros, so it would seem I need an idiots step by step guide as to how and where to place the appropriate code.
I have a dynamic table where the number of rows change based on a user selection. I have set up a Form Scrollbar and I want to be able to change the 'Maximum Value' setting for the scrollbar using VBA.
I get the number of rows in the table using a 'MATCH' function in cell A2 to give me an Integer value.
I have looked at a number of solutions, such as:
and
and many variations along similar lines, however everything I try generates an error.
The errors are either saying I need to declare a variable, but I don't know what I should be declaring, do I need to declare the scrollbar itself as a variable or the Range? or that
'it Cannot run the Macro because it may not be available in this workbook or all macros may be disabled' which they aren't because I have other macros running.
Questions- Should I be right clicking on the scrollbar and using the Assign Macro to add any code or should I be right clicking the sheet tab and using the 'View Code' option?
- Could anyone please show me the code I need to add and where and how I need to add it in full, including any variables I may need to declare.
I'm sure it is simple when you know how, but when you get an error and you don't understand it, it is hard to fix...
Many thanks
Bookmarks