VBA to get actual cell address from filtered list

Trickyrla

New Member
Joined
Jul 11, 2003
Messages
9
Hope you guys can help
This is probably really simple.

I have about 1000 rows of data in about 15 columns
These columns can be filtered.
Once filtered I would like to be able to select a cell and store its actual address in some vba code that will be initiated once the cell is selected, and then for subsequent use in some VBA code when the columns are not filtered.

I have worked out that Activecell.Address gives me the address of the selected cell, but this address is relative to the filtering. For example I am getting an address of say $A$2 as the ActiveCell.Address when the actual address of the selected cell is really on row 376 ie $A$376.

Can anyone suggest a way of getting the actual address please?
Many thanks

Tricky
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
If A376 was the actual selected cell, you would not get A2 as the returned value? Are you sure that you don't have multiple cells selected?

What does this give you?

msgbox "Selected cell is " & selection.address
 
Upvote 0
This is weird

correct address shows up in message, so everything should be OK.
have stepped through all lines of code again and found the problem.
Now I feel a real idiot!!
I had 2 variables to store the address in the first spelt curadds and the second curradds.
Now all seems OK I hope.
I just couldn't see for looking!!
Thanks for such a swift response.

Tricky
 
Upvote 0
No problem. I have to admit it probably won't be your last time you do that, because I know I have done that many of times.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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