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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
"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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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