Active Cell Address – Inactive Sheet

MrDB4Excel

Active Member
Joined
Jan 29, 2004
Messages
334
Office Version
  1. 2013
Platform
  1. Windows
How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current, active sheet.
This is done to always show the user if a specific cell is actually the active cell in a specific inactive worksheet.
In addition, to make this seem a bit more complicated, my workbook contains 6 sheets, labeled as follows:
Current Rates, USD2CZK Log, EUR2CZK Log, CZK2EUR Log, RUB2EUR Log, EUR2RUB Log.
I want to use VBA to get the cell address of the active cell in each of the sheets USD2CZK Log, EUR2CZK Log, CZK2EUR Log, RUB2EUR Log, EUR2RUB Log and place those cell references, 5 in all, on sheet Current Rates. (Incidentally, these active cell addresses are empty, no data is present)
In addition, the indicated cell addresses of the active cells in those 5 sheets are directly below, in the same column of those 5 sheets, the last entered data. So for example VBA’s results indicate the active cell in each of those 5 sheets is B678. I need to also have VBA return the cell address of the cell above the active cell wherein the last data was entered, in this example, B677.
I assume the VBA involved would need an entry for each of the 5 sheets.
I hope this is an easy fix, any help is greatly appreciated. I have scoured several web pages to find an answer and do not seem to find anything that remotely applies, close, but no cigar.
 
You could put code like this in every worksheet's code module
VBA Code:
Public Selection As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Set Selection = Target
End Sub

and refer to Worksheets("foo").Selection as needed.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You can try clicking the 'Report' button on the first post of that thread and asking admin to delete it.
If you do, I would strongly advise waiting until it has been done before posting a new one in order to avoid falling foul of the duplicate thread rules.
Jason,
How long might it take for admin to delete the original post? I did the report about 5 hours ago.
If I look for the original post and find it I can assume that they have not yet deleted the original?
 
Upvote 0
Most of the time it would be done in a matter of minutes (can be longer at weekends, they are all volunteers with other commitments outside of the forum).
It has been deleted, I just tried the link that you posted earlier.
 
Upvote 0
Most of the time it would be done in a matter of minutes (can be longer at weekends, they are all volunteers with other commitments outside of the forum).
It has been deleted, I just tried the link that you posted earlier.
Thanks, Jason, you have been most helpful.
I will repost tomorrow as it is just after midnight here in the Czech Republic.
 
Upvote 0

Forum statistics

Threads
1,215,088
Messages
6,123,057
Members
449,091
Latest member
ikke

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