Returning a result to active row?

Magriza

Well-known Member
Joined
Nov 16, 2005
Messages
508
Good evening to everyone in this time zone,

I'm sitting here listening to the JCB song: http://www.jcbsong.co.uk and trying to puzzle out a problem that's been bugging me all week. Any assistance would be gratefully appreciated.

If I have a spreadsheet where I use a macro to enter data in a defined range of cells, is it possible to have that macro also record specific result in the active row but outside the range?

For example: My macro would place a value in the active cell in the range A1:J10. If I select cell C3 and run the macro, I would like another - different - result to be displayed in cell L3. If I then select cell F10 and run the macro, another result would be displayed in cell L10. So the column remains fixed as "L" but the row is dependent on the active cell.

Hopefully that makes sense and that it's feasible.
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,048
Office Version
  1. 365
Platform
  1. Windows
Certainly sounds feasible.

But what value do you want to appear in column L?
 

Barrie Davidson

MrExcel MVP
Joined
Feb 10, 2002
Messages
2,330
Very feasible. Something like?
Code:
Dim DestinationRange As Range

Set DestinationRange = Cells(ActiveCell.Row, 12)
'your code
DestinationRange.Value = "Whatever" 'your code determines this

Does this help?
 

Magriza

Well-known Member
Joined
Nov 16, 2005
Messages
508
Hi Norie,

The result is dependent on a user form and gathered input. I'd managed to get that part working fine, just not how to place it where I needed it.

Barrie, thank you! You've saved my sanity (though some would say too late). It works perfectly! :biggrin:
 

Watch MrExcel Video

Forum statistics

Threads
1,118,228
Messages
5,571,008
Members
412,353
Latest member
SofiaV
Top