VBA to read both row & column numbers from cells

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
680
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have the code below that selects a range from cell BM76 using the row number from the value in cell BJ68 but the column is fixed as BU.
How can I adapt this code so it also reads the column number from cell BJ71 rather than it being fixed as BU?
Any help much appreciated.

Code:
Dim numrows As Long
numrows = Range("BJ68")


Range("BM76:BU" & numrows).Select
Selection.CopyPicture
 

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.
ok, have sussed this...

I have put a formula into cell BJ71 that returns the column letter of the last column used, this is then referenced in the vba as follows:

Range("BM76:" & Range("BJ71").Value & numrows).Select

Thank you to anyone that has spent any time looking at this for me.
 
Upvote 0

Forum statistics

Threads
1,215,960
Messages
6,127,942
Members
449,411
Latest member
sdescharme

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