Hello_World_Print
New Member
- Joined
- Jun 15, 2022
- Messages
- 3
- Office Version
- 2013
- 2010
- Platform
- Windows
I want to make a VBA code where both the x and y range are set from a different sheet (sheet2). The x range is dates and will remain in the same column no matter which dataset is imported into (sheet2). I know how to have a fixed y range from (sheet2) but I want the y range to change based on a cell value in (sheet6). For example, if cell(3,2) in sheet6 is Desk, I want the code to search through row(1) in sheet2 to find Desk. Once Desk is found, I want my new y range to be that column. The date range would be something like Worksheets(2).Range("A3:A15000") and the y range would be same length. I want this scatter plot to be printed on sheet6. This will also get repeated for sheet3 and sheet4. Row(1) in sheet2 is the heading for the data in that column.
If cell(3,2) in sheet6 is changed to Chair, I want the scatter plot to change y range once it finds Chair in sheet2 and sets the new range to that column instead. This is replicated to sheets3 and 4 so the scatter plot will have 3 different datasets.
Not sure if my question makes sense but would appreciate the help!
If cell(3,2) in sheet6 is changed to Chair, I want the scatter plot to change y range once it finds Chair in sheet2 and sets the new range to that column instead. This is replicated to sheets3 and 4 so the scatter plot will have 3 different datasets.
Not sure if my question makes sense but would appreciate the help!