Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Can I format one cell so that it affects another cell?

Cells A1 (feet) and B1 (meters) are formatted with data validation so that
only specific values can be entered in those cells. Can I format A1 so that
if I select one of the specific values, B1 will automatically display the
equivalent meter value from the defined list of values?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Can I format one cell so that it affects another cell?

Try VLOOKUP() to get the values from a list.
OR
try the CONVERT function which comes along with the Analysis ToolPak add-in.

=CONVERT(A1/12,"in","cm")*100

If this post helps click Yes
---------------
Jacob Skaria


"David" wrote:

Cells A1 (feet) and B1 (meters) are formatted with data validation so that
only specific values can be entered in those cells. Can I format A1 so that
if I select one of the specific values, B1 will automatically display the
equivalent meter value from the defined list of values?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Can I format one cell so that it affects another cell?

On Thu, 16 Jul 2009 06:20:10 -0700, David
wrote:

Cells A1 (feet) and B1 (meters) are formatted with data validation so that
only specific values can be entered in those cells. Can I format A1 so that
if I select one of the specific values, B1 will automatically display the
equivalent meter value from the defined list of values?


Not by formatting cells.
But you may try the following macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
feet_valuelist = Cells(1, "A").Validation.Formula1
feet_datavalues = Split(feet_valuelist, ",")
meter_valuelist = Cells(1, "B").Validation.Formula1
meter_datavalues = Split(meter_valuelist, ",")
If UBound(feet_datavalues) < UBound(meter_datavalues) Then
MsgBox "different number of options can't be handled"
Exit Sub
End If
For i = 0 To UBound(feet_datavalues)
If "" & Cells(1, 1).Value = feet_datavalues(i) Then
Cells(1, "B").Value = meter_datavalues(i)
Exit Sub
End If
Next i
End If
End Sub

The number of "specific values" must be same for the data validation
in cells A1 and B1, and the values must be sorted so that equivalent
values are in the same places in the data validation lists.

Hope this helps / Lars-Åke
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Can I format one cell so that it affects another cell?

Thanks. I'll try your suggestion.

"Jacob Skaria" wrote:

Try VLOOKUP() to get the values from a list.
OR
try the CONVERT function which comes along with the Analysis ToolPak add-in.

=CONVERT(A1/12,"in","cm")*100

If this post helps click Yes
---------------
Jacob Skaria


"David" wrote:

Cells A1 (feet) and B1 (meters) are formatted with data validation so that
only specific values can be entered in those cells. Can I format A1 so that
if I select one of the specific values, B1 will automatically display the
equivalent meter value from the defined list of values?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Can I format one cell so that it affects another cell?

Pretty complicated, but I'll try it out.

"Lars-Ã…ke Aspelin" wrote:

On Thu, 16 Jul 2009 06:20:10 -0700, David
wrote:

Cells A1 (feet) and B1 (meters) are formatted with data validation so that
only specific values can be entered in those cells. Can I format A1 so that
if I select one of the specific values, B1 will automatically display the
equivalent meter value from the defined list of values?


Not by formatting cells.
But you may try the following macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
feet_valuelist = Cells(1, "A").Validation.Formula1
feet_datavalues = Split(feet_valuelist, ",")
meter_valuelist = Cells(1, "B").Validation.Formula1
meter_datavalues = Split(meter_valuelist, ",")
If UBound(feet_datavalues) < UBound(meter_datavalues) Then
MsgBox "different number of options can't be handled"
Exit Sub
End If
For i = 0 To UBound(feet_datavalues)
If "" & Cells(1, 1).Value = feet_datavalues(i) Then
Cells(1, "B").Value = meter_datavalues(i)
Exit Sub
End If
Next i
End If
End Sub

The number of "specific values" must be same for the data validation
in cells A1 and B1, and the values must be sorted so that equivalent
values are in the same places in the data validation lists.

Hope this helps / Lars-Ã…ke

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
cell format - remove cell format pattern without effecting colors Bas Excel Discussion (Misc queries) 1 March 23rd 09 02:54 PM
auto-hide rows, cell format (# and @), update cell refs, shade cel Mo2 Excel Discussion (Misc queries) 0 April 17th 07 03:44 AM
Can cell format come from and change with reference cell format jclouse Excel Discussion (Misc queries) 1 November 29th 06 03:20 AM
format cell to show leading zeros and make cell a three digit fiel Kristin Excel Worksheet Functions 2 July 28th 06 09:42 PM
How do I copy data in single cell format to a merged cell format Paul Excel Discussion (Misc queries) 1 June 27th 05 11:00 AM


All times are GMT +1. The time now is 03:19 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"