Insert_Key
New Member
- Joined
- Jun 4, 2019
- Messages
- 16
- Office Version
- 2016
- Platform
- Windows
Hi there. I am seeking some help to automate a process in Excel.
I suspect it would be a piece of cake in VBA, but don’t know the first thing about VBA – tried to fill in some blanks through Google but didn’t get very far, so here I am! ??
When a user selects a value from a dropdown list, I would like (1) all of the rows in the active worksheet to resize (height) to fit the contents of their cells, and also (2) clear the contents of a specific cell. The cell that has just been cleared contains a second dropdown list and when the user makes a selection from it, (3) all rows on the active sheet need to resize to fit again.
The workbook has four worksheets. For simplicity, let’s call them “Sheet A”, “Sheet B” and “Sheet C”, plus a hidden helper sheet called “Sheet H”. Word Wrap is on.
There is currently only data in cells B2:C26. The number of rows may change in the future and I use select all as I find convenient when completing my manual process, however if it is likely to introduce issues (e.g. with performance), I am happy to use the range provided above and adjust if/when required.
Any help will be extremely gratefully received! ?
Thanks in advance,
Andy
I suspect it would be a piece of cake in VBA, but don’t know the first thing about VBA – tried to fill in some blanks through Google but didn’t get very far, so here I am! ??
When a user selects a value from a dropdown list, I would like (1) all of the rows in the active worksheet to resize (height) to fit the contents of their cells, and also (2) clear the contents of a specific cell. The cell that has just been cleared contains a second dropdown list and when the user makes a selection from it, (3) all rows on the active sheet need to resize to fit again.
The workbook has four worksheets. For simplicity, let’s call them “Sheet A”, “Sheet B” and “Sheet C”, plus a hidden helper sheet called “Sheet H”. Word Wrap is on.
- The data that I want resized is on Sheet C
- Sheet C is essentially a user-friendly read-only view of information on Sheet B
- ‘Sheet C’!B2:B26 contains descriptions (text only)
- ‘Sheet C’!C2:C26 contain VLOOKUPs, plus two cells with drop down lists (Data Validation)
- The Data Validation Lists are in cells ‘Sheet C’!C2 (let’s call this Product ID) and ‘Sheet C’!C14 (let’s call this one Part ID)
- Selecting an item from each Data Validation List populates other cells through VLOOKUP queries, returning related data from Sheet B
- When an Product ID is selected, clear the Part ID and resize all row heights:
- Click in ‘Sheet C’!C2
- Select the desired Product ID from dropdown list
- Clear contents of ‘Sheet C’!C14
- Select all
- Resize row height to fit contents
- When a Part ID is selected, resize all row heights:
- Click in ‘Sheet C’!C14
- Select the desired Part ID from dropdown list
- Select all
- Resize row height to fit contents
There is currently only data in cells B2:C26. The number of rows may change in the future and I use select all as I find convenient when completing my manual process, however if it is likely to introduce issues (e.g. with performance), I am happy to use the range provided above and adjust if/when required.
Any help will be extremely gratefully received! ?
Thanks in advance,
Andy