Range Manipulation

Comfy

Well-known Member
Joined
Dec 21, 2009
Messages
3,386
I'm wondering whether it is possible to manipulate multiple cells in a range at the same time.

EG

Code:
Dim rng As Range
Set rng = Range(Cells(1, 1), Cells(4, 4))

I can edit one cell rng(1).Formula or rng(5).Value

but is it possible to select a range within that range

rng(1 - 5)??
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Example:-
Code:
Dim rng As Range
Set rng = Range(Cells(10, 1), Cells(20, 5))
MsgBox rng.Address
MsgBox rng.Range(Cells(5, 1), Cells(10, 5)).Address
Mick
 
Upvote 0
It's taken me 3 days to get where I am and I think this is my final hurdle.

This works:

Code:
rng.Range(Cells(1, 3), Cells(1, 3)).Value = Application.WorksheetFunction.Round((Cells(i, NBVCol) / (Cells(i, LifeCol).Value) * (Cells(i, LifeCol).Value - 6)), 2)

This doesn't:
Code:
rng.Range(Cells(1, startQ + 1), Cells(1, 4)).Value = rng.Range(Cells(1, startQ + 1), Cells(1, 4)).Value + Application.WorksheetFunction.Round((ADrng(i) / (Life - (i - 1))) * 3, 2)

I can only assume it's because I'm trying to add a single value to an array of cells.

Does anyone know if that's correct and if so how to over come it?

Thanks,
/Comf
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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