#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default If Then ?

Is it possible to assign a currancy value to a cell based upon the text
string in another cell?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default If Then ?

Using a macro - but not with a formula.

You can also look at the Text worksheet function.

--
Regards,
Tom Ogilvy


"Jermert" wrote:

Is it possible to assign a currancy value to a cell based upon the text
string in another cell?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default If Then ?

Perhaps I should be more explicit; I have a simple invoice with pull down
boxes in the service description area, these are common items we charge for,
the rates for these items is also consistant. What I would like to do is auto
fill the Cost @ depending on the pull down item selected. Thanks

"Jermert" wrote:

Is it possible to assign a currancy value to a cell based upon the text
string in another cell?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default If Then ?

Here's an example:

Sub Test()
For Each Cell In ActiveSheet.Range("B1:B2")
If Cell.Value = "Test" Then
Cell.Offset(0, -1) = Format(Cell.Offset(0, -1), "$0.00")
End If
Next Cell
End Sub

--
Dan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default If Then ?

This is probably more what you're looking for. Put this code behind
the sheet, not in a module.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Long
R = Target.Row
If Target.Column = 1 Then
Select Case Cells(R, 1)
Case Is = "Oil Change": Cells(R, 2) = "14.95"
Case Is = "Tune Up": Cells(R, 2) = "59.95"
'Case Else
End Select
End If
End Sub

--
Dan



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default If Then ?

I would assume you have a lookup table in the workbook where you have a row
with the item identifier (from the dropdown) in the left most column and the
price next to it. then you would use Vlookup

Assume

the lookup table is in a sheet named DataSheetName with the identifiers in
column A and the prices in column B.

the dropdown is in B2 of another sheet (Invoice sheet)

in C2 of that sheet as an example
=if(B2="","",Vlookup(B2,DataSheetName!A:B,2,false) )

--
Regards,
Tom Ogilvy


"Jermert" wrote:

Perhaps I should be more explicit; I have a simple invoice with pull down
boxes in the service description area, these are common items we charge for,
the rates for these items is also consistant. What I would like to do is auto
fill the Cost @ depending on the pull down item selected. Thanks

"Jermert" wrote:

Is it possible to assign a currancy value to a cell based upon the text
string in another cell?

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



All times are GMT +1. The time now is 12:42 AM.

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

About Us

"It's about Microsoft Excel"