Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Excel 2003: automatically changing a cell's contents based on keyword entered

Reply  
Thread Tools
stepheny2k2's Avatar
Computer Specs
Member with 48 posts.
 
Join Date: Jul 2006
Location: Carlisle/Manchester in UK
Experience: Intermediate
26-Mar-2009, 11:42 AM #1
Question Excel 2003: automatically changing a cell's contents based on keyword entered
I have built a simple timesheet for someone in my dept, which includes amongst other things:

- hours worked over a month,
- how many hours owed/extra worked
- a cumulative of this figure over the months.

The requestor wants to be able to type a letter such as 'e' to represent a 07:30hr shift. So they type 'e' and the cell contents change to 07:30. There are about 6 different codes.

Normally a Vlookup would work EXCEPT you can't change the contents of the cell your are working upon.....cicrular referencing!

I could see two ways forward: either a function that allows the above

OR (perhaps more favourably)

leaving the lookups until the hour calculations at the base of the form. i.e Instead of a simple Sum for the hours worked that month, it could read the values in the range, look them up from a table(vlookup), and then sum the looked up figures to give the answer in the 'hours worked' cell.

I vaguely remember this being possible from my university days but can't remember how.

Can anyone help me?
computerman29642's Avatar
Computer Specs
Senior Member with 2,794 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
26-Mar-2009, 11:45 AM #2
Can you attach a sample file (remove sensitive data with dummy data)?
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 5,030 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
26-Mar-2009, 11:57 AM #3
Hi there,

I recommend conditional formatting from the sounds of it. But I hesitate leaving this alone with that sole recommendation after reading your post. I am curious to look at your workbook, it sounds like there may be other things we can do with it, i.e. reduce some inefficiencies.

Would you agree, Chris?
computerman29642's Avatar
Computer Specs
Senior Member with 2,794 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
26-Mar-2009, 12:04 PM #4
Quote:
Originally Posted by Zack Barresse View Post
Hi there,

I recommend conditional formatting from the sounds of it. But I hesitate leaving this alone with that sole recommendation after reading your post. I am curious to look at your workbook, it sounds like there may be other things we can do with it, i.e. reduce some inefficiencies.

Would you agree, Chris?
I agree.
stepheny2k2's Avatar
Computer Specs
Member with 48 posts.
 
Join Date: Jul 2006
Location: Carlisle/Manchester in UK
Experience: Intermediate
26-Mar-2009, 12:12 PM #5
Okay I have attached a sample of what I have done.

I have to stress this was just a prototype to test the feasability of what she was asking for and whether it matched her expectations.

But hope it makes things a little clearer.

Anything else you need or require further explanation of let me know.
Attached Files
File Type: xls sampleTimesheet.xls (28.0 KB, 99 views)
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 5,030 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
26-Mar-2009, 01:51 PM #6
Perhaps an in-cell drop down for the times, with them already populated in a pre-defined list? I've made many time sheets, and that is what I do 90+% of the time.

Take a look at the changed sheet, there is a list, then look at E4. Would that help, or is that what you're looking for? Also, is the time just time checked-in? What exactly are the codes for and how are they supposed to work (not necessarily how implimented, leave that to us )?
Attached Files
File Type: xls sampleTimesheet(1).xls (34.0 KB, 92 views)
computerman29642's Avatar
Computer Specs
Senior Member with 2,794 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
26-Mar-2009, 02:11 PM #7
Why does the user want the time displayed again in Column P?
MRdNk's Avatar
Computer Specs
Member with 439 posts.
 
Join Date: Apr 2007
Location: UK
Experience: Damn I'm good!
26-Mar-2009, 03:39 PM #8
It is possible to do what you originally asked for, but it seems slightly overkill, as the user can just type in 7:30 or select it from a list like you currently have.

However, here is a starting point, for your original question, this can be extended to include a list on your second lookup sheet:
NB. Put the code behind Sheet1.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim t As String
    If Not Intersect(Target, Range("A1:A5")) Is Nothing Then
        If Target.Value = "e" Then
            Target.FormulaR1C1 = "7:30"
        End If
    End If

End Sub
__________________
MRdNk
-----------
Web App Developer: .NET, JavaScript and SQL
Reply

Tags
circular reference, excel, excel 03, vlookup

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:13 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.