Select a Range based on cell value

Rhadida

Board Regular
Joined
Nov 26, 2003
Messages
159
I would like to select a range based on cell value.

For example:

The cells C1:L1 contain the descriptions.
In cells C2:C13 I have alle the months (01-01-04, 01-02-04, etc.)
The cells D2:L13 contain supplies.
Cells D14:L14 contain the totals of the column.

Now I want to select C1:C13 and the rest of the columns until the value in row 14 reaches 0. E.G. F14 = 0, so I want to select C1:E13. Is this even possible???
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try this?
Code:
Sub selcells()
Range("D14").Activate
Do Until ActiveCell.Value = 0
ActiveCell.Offset(0, 1).Activate
Loop
Range(ActiveCell.Offset(-1, 0), "C1").Select
End Sub
HTH
 
Upvote 0
Thanx this works perfectly, the only change I had to make was the cell offset. From -1, 0 to -1,-1.

THANXXXXXXX :p
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,684
Members
448,977
Latest member
dbonilla0331

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