Using cell value to change range size

Defski

New Member
Joined
Apr 25, 2018
Messages
34
Office Version
  1. 365
Platform
  1. Windows
I am looking for help to make the following happen.

Say like I have a range that is from A20:C50, how can I make it so if a value in cell lets say cell A5 was "8" my new range would be A28:C50.

Ultimately I would like to be able to take the remaining data and copy and paste it into another sheet.

I assume this requires a VBA solution???


Thanks,
 
Thanks for explaining that.
But I do not understand:
ending data that is leftover in a range

When this inventory is used up the only data that would be important is the remaining data left,
If the inventory is used up I would think nothing would be left.

How do we know when inventory is used up?
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I use the value in cell D24 to count down to the row where inventory remains.

So if there is a 20 in cell D24 it will count down that many rows and the remaining from that point is left over.
 
Upvote 0
Anymore help on this?

range(Cells(range("D24").Value + 30, 1), range("C58")).Select

This is what I am currently using to almost get what I need done. but the end of the range is not dynamic, its fixed to C58.

Is there away to use the first part of this code and then have it dynamically find the end of the range no matter how many rows it may contain?
 
Upvote 0
There are several of us here who have tried to help you but in my case I just do not understand what your wanting.

And i believe your just wanting one piece of code to add to some other code your working with to get a end result which I do not know.
And just repeating what you have already said will not help me.
 
Upvote 0
How about
Code:
Range(Cells(Range("D24").Value + 30, 1), Range("C" & Rows.Count).End(xlUp)).Select
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,022
Latest member
RobertV1609

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