Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Automatic Value conversion

I have a spreadsheet in which I would like the user to be able to enter
either a Square foot Dimension or a Square meter dimesion (Whichever one
they have handy) And have excel return the converted value in the "entry
cell" for appropriate dimension type.


For example Column 1 is Labeled Square Meter And Column 2 is labled Square
Feet

If the user enters a value in Column 1, Excel fills the cell in column 2,
with the converted value. This should work in reverse if the user enters a
value in column 2.

Here is some code provided to me by a fellow news groupie.

My question is how do I define the range of appropriate cells? and how do I
run the macro? (I would like it to run automatically, invisible to the user)

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target = "" Then Exit Sub
Application.EnableEvents = False
If Target.Column = 2 Then Target.Offset(, -1) = Target * 0.0929
If Target.Column = 1 Then Target.Offset(, 1) = Target * 10.76
Application.EnableEvents = True


Thank you for your help!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Automatic Value conversion

In article ,
"Dustin" wrote:

My question is how do I define the range of appropriate cells? and how do I
run the macro? (I would like it to run automatically, invisible to the user)


The macro will run automatically if you put it in the worksheet code
module (right-click the worksheet tab and choose View Code). When a
value is entered in column 1 or 2, the calculation takes place and the
result put in column 2 or 1.

The code's already set up to work on the "range of appropriate cells"
specified in your example - it will work if a value is entered in
Columns 1 or 2 (A or B).

What range are you looking for?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Automatic Value conversion

You are right, it works just fine!
I just had to change the column numbers 4 and 3 in my case!

"JE McGimpsey" wrote in message
...
In article ,
"Dustin" wrote:

My question is how do I define the range of appropriate cells? and how

do I
run the macro? (I would like it to run automatically, invisible to the

user)

The macro will run automatically if you put it in the worksheet code
module (right-click the worksheet tab and choose View Code). When a
value is entered in column 1 or 2, the calculation takes place and the
result put in column 2 or 1.

The code's already set up to work on the "range of appropriate cells"
specified in your example - it will work if a value is entered in
Columns 1 or 2 (A or B).

What range are you looking for?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automatic Value conversion

How would anyone know?

--
Regards,
Tom Ogilvy

"Dustin" wrote in message
...
You are right, it works just fine!
I just had to change the column numbers 4 and 3 in my case!

"JE McGimpsey" wrote in message
...
In article ,
"Dustin" wrote:

My question is how do I define the range of appropriate cells? and how

do I
run the macro? (I would like it to run automatically, invisible to the

user)

The macro will run automatically if you put it in the worksheet code
module (right-click the worksheet tab and choose View Code). When a
value is entered in column 1 or 2, the calculation takes place and the
result put in column 2 or 1.

The code's already set up to work on the "range of appropriate cells"
specified in your example - it will work if a value is entered in
Columns 1 or 2 (A or B).

What range are you looking for?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable automatic nr conversion Mau Excel Discussion (Misc queries) 2 October 10th 07 08:31 AM
Automatic conversion to scientific numbers cew47 Excel Discussion (Misc queries) 2 July 17th 07 07:40 PM
Automatic Formula to Value Conversion workerboy Excel Worksheet Functions 1 August 8th 06 07:59 PM
Automatic Currency Conversion Paul Sheppard Excel Discussion (Misc queries) 0 August 6th 06 08:40 AM
Automatic CSV Data Conversion Guillaume Genest Setting up and Configuration of Excel 1 January 6th 06 10:19 PM


All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"