VBA: Find specific value in a static range and adjust x-axis maximum of a chart based on found value

LukiiMaxim96

New Member
Joined
May 18, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi.. I need a little bit help with that one.

I managed to write a VBA code to copy paste the range C7:AX10 from another workbook and now, I would like to have the chart's x-axis automatically adjusted to the maximum value "100" which would be in AI8.

This is my start so far..:
Range("C8:AX8").Find("100")

I do not now how to continue. Every hint is appreciated.
Thank you.


1.PNG
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
"Progress" or workaround for everyone interested

VBA Code:
OpenBook.Sheets(2).Range("C8:AX10").Replace _
What:="0%", Replacement:=""
    
OpenBook.Sheets(2).Range("C8:AX10").Replace _
What:="#N/A", Replacement:=""

2.PNG
 
Upvote 0

Forum statistics

Threads
1,215,794
Messages
6,126,945
Members
449,349
Latest member
Omer Lutfu Neziroglu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top