• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Is it possible to assign a five digit code a value?

nmorrison

New Member
I have to enter a patient's name and a five digit cpt code into a daily spreadsheet It would make my life so much easier if I knew how to assign the two codes a monatary value..for example if 12345 is a code for $45 and 54321 was a code for $85. I could do auto sum in the total and it would take up a lot less of my time, then adding the numbers by hand and then putting the total at the end of each row and doing auto sum
 
Hi, nmorrison!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


If I understood correctly, you should give a look to the following link; if I'm wrong, please elaborate a bit more and upload a file so as to make easier to get the point.

https://dl.dropbox.com/u/60558749/Is%20it%20possible%20to%20assign%20a%20five%20digit%20code%20a%20value_%20%28for%20nmorrison%20at%20chandoo.org%29.xlsx


Regards!
 
@b(ut)ob(ut)hc

Hi, old dog new fully tricked!

Good afternoon for you too, and thanks for the compliment. If I weren't so lazy I should've added subtotals by day and week/month.

Regards!
 
Hi, nmorrison


You might try this to make entering your data a bit easier/quicker.

Copy and paste in the vb editor of sheet Hoja2.

I assigned short-cut keystroke to both codes ctrl + a & ctrl + e.


Option Explicit


Sub PatientAdd()

'ctrl + a

Dim PName As String

Dim CptC As String


PName = InputBox(" Enter patient's name")

Range("B1000").End(xlUp).Offset(1, 0) = PName

Range("B1000").End(xlUp).Offset(0, -1) = Now()


CptC = InputBox(" Enter Cpt Code")

Range("C1000").End(xlUp).Offset(1, 0) = CptC


End Sub


Sub EditMyPatient()

'ctrl + e

Dim MyEdit As String

Dim Msg, Style, Title, Response


Msg = "Do you want edit patient list ?"

Style = vbYesNo

Title = "EditMyPatient"


Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then

MyEdit = InputBox(" Enter patient name")

Cells.Find(What:=MyEdit, After:=ActiveCell, LookIn:=xlFormulas, _

LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _

SearchFormat:=False).Activate

Else

Exit Sub


Regards,

Howard
 
Back
Top