Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel -- Sending Information to a specific Location

Status
Not open for further replies.

avandale

Technical User
Dec 10, 2003
7
IE
I'm working with a Userform and a spreadhsheet to create an Employee Absence Tracker.

In column A of the spreadsheet, are the days of the year. Across the top row are the names of employees. I want to select a name on the userform (populated by the employees row) and the date of an absence. I want the form to insert the absence in the cell where the employee name and date intersect. I've tried the intersect keyword, and I've tried the "goto" reference, but neither seem to work with more than one named range. This is driving me crazy, because it seems like such an obvious function within VB/Excel, but I just can't seem to get it to work!

Is there a simple and obvious solution staring me in the face????

Thanks in advance

 
Hi,

Use FIND on the employee & Date
Code:
    Set rngEmp = Rows(1).Find(ActiveSheet.TextBox1.Text)
    Set rngDate = Columns(1).Find(Format(ActiveSheet.TextBox2.Text, "m/d/yyyy"))
    Application.Intersect(Columns([rngEmp].Column), Rows([rngDate].Row)).Select
make sure that your date format is consistent with the format in your sheet

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top