ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Then ? (https://www.excelbanter.com/excel-programming/393025-if-then.html)

Jermert

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

Tom Ogilvy

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?


Jermert

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?


Dan R.

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


Dan R.

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


Tom Ogilvy

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?



All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com