Reassigning cell range

nascent13

New Member
Joined
Jun 15, 2011
Messages
1
I'm trying to move down columns. Basically, I'm referencing two cells for a formula, which need to be offset as I go down the columns. However, I'm getting an "object required" error when I'm reassigning "balance" to the next cell down. I can't really remember how to reassign a cell, so any help is appreciated!

Code:
Sub annexa()
'variable cells
Dim balance, ltv, proRatBal As Range
balance = Range("N2")
ltv = Range("AQ2")
 
'STEP 2: FIND PRO-RATA VALUES
Range("CC1").Select
ActiveCell.Value = "Pro-rata value"
'start inputting values
ActiveCell.Offset(1, 0).Select
 
Do Until IsEmpty(ActiveCell)
    ActiveCell.Formula = balance / ltv
    Set balance = Range(balance.Offset(1, 0))
    Set ltv = Range(ltv.Offset(1, 0))
    ActiveCell.Offset(1, 0).Select
Loop
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Perhaps

Code:
Sub annexa()
'variable cells
Dim balance As Range, ltv As Range, proRatBal As Range
Set balance = Range("N2")
Set ltv = Range("AQ2")
 
'STEP 2: FIND PRO-RATA VALUES
Range("CC1").Value = "Pro-rata value"
'start inputting values
ActiveCell.Offset(1, 0).Select
 
Do Until IsEmpty(ActiveCell)
    ActiveCell.Value = balance.Value / ltv.Value
    Set balance = balance.Offset(1, 0)
    Set ltv = ltv.Offset(1, 0)
    ActiveCell.Offset(1, 0).Select
Loop
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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