Storing Values by clicking on them

anubhavm10

New Member
Joined
Jul 10, 2014
Messages
6
[TABLE="width: 500"]
<tbody>[TR]
[TD]CrankAngle[/TD]
[TD]1100 RPM[/TD]
[TD]1200 RPM[/TD]
[TD]1300 RPM[/TD]
[/TR]
[TR]
[TD]360[/TD]
[TD]0.7 Pascal[/TD]
[TD]0.5 Pa[/TD]
[TD]0.6 Pa[/TD]
[/TR]
[TR]
[TD]359[/TD]
[TD]0.6 Pa[/TD]
[TD]0.6 Pa[/TD]
[TD]0.8 Pa[/TD]
[/TR]
[TR]
[TD]358[/TD]
[TD]0.5 Pa[/TD]
[TD]0.4 Pa[/TD]
[TD]0.9 Pa[/TD]
[/TR]
[TR]
[TD]357[/TD]
[TD]0.4 Pa[/TD]
[TD]0.3 Pa[/TD]
[TD]0.3 Pa[/TD]
[/TR]
</tbody>[/TABLE]
I have a spreadsheet of pressures with rpm as columns and Crank Angles as Rows. My task is to write a macro to extract a particular set of rpm, a pressure for that rpm and corresponding crank Angle. The user should click on the required RPM cell and the RPM value gets stored . Then the user should click on the required pressure cell and the pressure value gets stored.
Then the user should click on the corresponding crank angle cell and the crank angle value gets stored in a separate variable. I have tried using the Worksheet_SelectionChange but it only works for one value ( ie the first one RPM).

Is it possible to write this code in a module , without going to worksheet code . Please help , I am new to VBA programming.
 
The code need to understand where the data is on the sheet and help from your layout is basic to that requirement.
When you run any code , it is looking for pointers to tell it where it is, your layout makes it more difficult.
There appears to be some inconsistencies like Pressure cells that have pressure units and other without also Vb code and merged cells are not good partners.
If you can sort those two points It should be possible to write some code.
Please confirm
If possible please state the start point (cell addresses) for the two tables.
 
Upvote 0

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