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
 

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,934
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
 

Trickyrla

New Member
Joined
Jul 11, 2003
Messages
9
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
 

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,934
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.
 

Forum statistics

Threads
1,081,899
Messages
5,361,928
Members
400,666
Latest member
UDLearning

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top