activecell.range

TiaXL

Board Regular
Joined
Jun 17, 2011
Messages
124
what is the syntax to determine the range reference of the activecell (for e.g "A1") to use in a formula

activecell.range or activecell.address ?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How about just ActiveCell ?

ActiveCell.Value = "Hello"


ActiveCell - this by itself is a range OBJECT.
ActiveCell.Address - This is a STRING representing the address of the active cell
 
Upvote 0
ActiveCell.Address

thanks if I want to then store this and use in a formula does this suffice ?

dim iMinRow as range
dim iMaxRow as range

iMinRow = activecell.address
iMaxRow = activecell.address

activecell.formula = "=SUM(" & iMinRow & ":" & iMaxRow & ")"
 
Upvote 0
How about just ActiveCell ?

ActiveCell.Value = "Hello"


ActiveCell - this by itself is a range OBJECT.
ActiveCell.Address - This is a STRING representing the address of the active cell

I dont want the value I want the cell reference to use in a formula as I cant get my head round the worksheet.function at the moment :P
 
Upvote 0
ActiveCell.Address is equivalent to ActiveCell.Address(1,1) which would return "$A$1"

If you just wanted "A1" then
ActiveCell.Address(0, 0)

Other combinations of 0s and 1s to get a mix of relative and absolute addresses.
 
Upvote 0
That would be something like

Code:
ActiveCell.Formula = "=SUM(" & ActiveCell.Address & ")"
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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