Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Keeping Exchange Rate With Status

hi,

my xchange rate is in A1 which is chang on daily basis, so i want if status
is in stock then want let change exr on daily basis, if status is changed to
sold then want keep previous rate.

A1 = Exchange rate (change on daily basis)
B4 = Status (change when product sold)
=IF($B4="Stock",$A$1,"")



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 267
Default Keeping Exchange Rate With Status

hi
is the exchange rate in a1 updated manually by a user or is it a formula
that calculates exchange rate dependant on something else?


"Tufail" wrote:

hi,

my xchange rate is in A1 which is chang on daily basis, so i want if status
is in stock then want let change exr on daily basis, if status is changed to
sold then want keep previous rate.

A1 = Exchange rate (change on daily basis)
B4 = Status (change when product sold)
=IF($B4="Stock",$A$1,"")



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Keeping Exchange Rate With Status

it's manually input...

"Atishoo" wrote:

hi
is the exchange rate in a1 updated manually by a user or is it a formula
that calculates exchange rate dependant on something else?


"Tufail" wrote:

hi,

my xchange rate is in A1 which is chang on daily basis, so i want if status
is in stock then want let change exr on daily basis, if status is changed to
sold then want keep previous rate.

A1 = Exchange rate (change on daily basis)
B4 = Status (change when product sold)
=IF($B4="Stock",$A$1,"")



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 267
Default Keeping Exchange Rate With Status

I think the best way will be to use the visual basic editor. alt f11
click on the worksheet in question (in this example sheet1) and select
worksheet in the left drop dowm box.
Paste the following in there

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Worksheets("sheet1")
If .Range("B4") = "sold" Then
.Range("C4") = .Range("A1").Value
.Range("B4") = "sold " & Format(Now(), "mm/dd/yyyy") & " " & "at"
End If
End With
End Sub

Im guessing that C4 would contain the formula you posted in your question.

this example will only work for the single cell B4, I am also guessing that
you have a whole column of sold and in stock entries that you would wish this
to apply to.
in this case use the following instead:

With Worksheets("Sheet1").Range("B4:B1000")
Dim c As Range
Set c = .Find("sold", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = "sold " & Format(Now(), "mm/dd/yyyy") & " " & "at"
c.Offset(0, 1).Value = .Range("A1").Value
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress

End If
End With
End Sub

"Tufail" wrote:

hi,

my xchange rate is in A1 which is chang on daily basis, so i want if status
is in stock then want let change exr on daily basis, if status is changed to
sold then want keep previous rate.

A1 = Exchange rate (change on daily basis)
B4 = Status (change when product sold)
=IF($B4="Stock",$A$1,"")



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 267
Default Keeping Exchange Rate With Status

in fact seeing as how it changes the value instantly it doesnt need to be
looped.

With Worksheets("Sheet1").Range("B4:B1000")
Dim c As Range
Set c = .Find("sold", LookIn:=xlValues)

If Not c Is Nothing Then

c.Value = "Sold " & Format(Now(), "mm/dd/yyyy") & " " & "at"
c.Offset(0, 1).Value = Range("A1").Value

End If
End With
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 267
Default Keeping Exchange Rate With Status

Sorry forgot to add in "look at xlwhole" this should work better.
I added in the date and "at" so that in column A it should state the product
in B sold (what ever todays date is) at then in column C the exchange rate
for that day.
Ground Almonds sold 09/12/09 at 1.2

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Worksheets("Sheet1").Range("B4:B1000")
Dim c As Range
Set c = .Find("sold", LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
c.Value = "Sold " & Format(Now(), "mm/dd/yyyy") & " " & "at"
c.Offset(0, 1).Value = Range("A1").Value
End If
End With
End Sub

"Tufail" wrote:

hi,

my xchange rate is in A1 which is chang on daily basis, so i want if status
is in stock then want let change exr on daily basis, if status is changed to
sold then want keep previous rate.

A1 = Exchange rate (change on daily basis)
B4 = Status (change when product sold)
=IF($B4="Stock",$A$1,"")



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
FORMULA: calculating an exchange rate Shevvie Excel Discussion (Misc queries) 1 January 26th 09 02:33 PM
How to create a Exchange Currency Rate into Excel Blue Fish[_2_] Excel Worksheet Functions 3 May 30th 08 01:30 PM
euro-sterling exchange rate Roger on Excel Excel Discussion (Misc queries) 2 November 25th 07 03:52 PM
vlookup for exchange rate Gábor Excel Worksheet Functions 2 July 21st 06 10:41 PM
how to calculate exchange rate? papa404 Excel Discussion (Misc queries) 2 August 2nd 05 02:43 PM


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