Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with 2 worksheets. Basically it is a daily sales
log. On worksheet 1 the user will input multiple daily sales figures and the date. Worksheet 2 is the historical sales figures. The theoretical usage will be for the end user to go to worksheet 1, enter the date and daily sales figures and click the save data button. I am seeking a formula that will look at the date entry and paste the values from worksheet 1 into the proper line on worksheet 2 based on the date entry from worksheet 1. Example: Column A of worksheet 2 is simply a list of dates. January 13, 2010 is in cell A378. The user makes the entries on worksheet 1 including 01/13/2010 in cell D1 of worksheet 2. Sales figures are enterred into multiple lines of worksheet 2 starting with cell D5. When the user clicks the save data button, I need the formula or script that will look at W1, Cell D1, match it to the corresponding entry in column A on worksheet 2, in this case A378 and record the sales figures from worksheet 1 in the correct columns of line 378 on worksheet 2. As always, your assistance is greatly appreciated. Don |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Try something like this. I think there were a few inconsistencies in your posting so I'm not sure if I got it right. with Sheets("Sheet1") W1 = .Range("D1") Amount = .range("B1") end with with Sheets("Sheet2") 'convert the date to a string to be used in the search in column A DateStr = format(W1,"mm/dd/yyyy") set c = .columns("A").find(what:=DateStr,lookin:=xlvalues, lookat:=xlwhole) if c is nothing then msgbox("Cannot find Date : " & DateStr) else LastCol = .cells(c.row,columns.count).end(xltoleft).column if LastCol < 5 then NewCol= 5 else NewCol = Lastcol + 1 end if .cells(c.row,NewCol) = Amount end if end with -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=169957 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MATCHING AND PASTING DATA | Excel Discussion (Misc queries) | |||
can excel auto correct when cutting and pasting | Excel Discussion (Misc queries) | |||
Why it is not pasting it to the correct place? | Excel Programming | |||
Pasting to Cells from TextBox User Control | Excel Programming | |||
USer Form Entry to multiple cells | Excel Programming |