Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Price List For Sales Representative

Hello, I need help!

I am trying to do a price list for my representatives where we have our
retail prices and also I would like to have a price code for my bottom
line price.

The code should have the words MAKEPROFIT as the key for 1234567890

therefore a price $11.33 should display MM.KK or $44.77 should display
EE.OO

could anybody help with this issue?

Thank you,

Claudio

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Price List For Sales Representative

Quick and dirty with minimal testing:-

Const code As String = "MAKEPROFIT"

Sub TestConvertToCode()
'Converts number to code
With ActiveCell
.Value = ConvertToCode(.Value)
End With
End Sub

Sub TestConvertToNum()
'Converts code back to number
With ActiveCell
.Value = ConvertToNum(.Value)
End With
End Sub

Function ConvertToCode(Val As Single) As String
Dim i As Integer
Dim t As String, tt As String, v As String

v = Format(Val, "#.00")
For i = 1 To Len(v)
t = Mid(v, i, 1)
Select Case t
Case 0
tt = tt & "T"
Case "."
tt = tt & t
Case Else
tt = tt & Mid(code, CInt(t), 1)
End Select
Next
ConvertToCode = tt
End Function

Function ConvertToNum(txt As String) As String
Dim i As Integer, n As Integer
Dim t As String, tt As String

For i = 1 To Len(txt)
t = Mid(txt, i, 1)
Select Case t
Case "T"
n = 0
tt = tt & n
Case "."
tt = tt & t
Case Else
n = InStr(code, t)
tt = tt & n
End Select
Next
ConvertToNum = Format(tt, "#.00")
End Function

Regards,
Greg

" wrote:

Hello, I need help!

I am trying to do a price list for my representatives where we have our
retail prices and also I would like to have a price code for my bottom
line price.

The code should have the words MAKEPROFIT as the key for 1234567890

therefore a price $11.33 should display MM.KK or $44.77 should display
EE.OO

could anybody help with this issue?

Thank you,

Claudio


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
Sales history and how Unit Price affects it... JC Charts and Charting in Excel 1 June 25th 08 06:02 PM
analysing sales vs price Vabu3184 Excel Worksheet Functions 1 August 15th 06 07:57 AM
How do I calculate profit as a % of Sales price bobnewmark Excel Discussion (Misc queries) 3 July 15th 06 12:27 AM
base price list compute on to another price list? on excel work sh excel spread sheet Excel Discussion (Misc queries) 0 March 29th 06 06:20 PM
Computing Sales Tax and Retail Price from a number Lani Jo Excel Worksheet Functions 8 February 16th 05 08:06 PM


All times are GMT +1. The time now is 02:23 AM.

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"