Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
this what i need i have the main sheet, which all the data is placed o to, then sheets for each month, what i want is when data is placed int the main sheet and the date is entered it copies that row into th coresponding sheet. so ie colum f contains the date if it is say 20/7/04 then it copie that row into the next avaible row of the july sheet. Thank -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi pauluk
Try this There is no error checking to see if there is a date in A1 or if the sheet exist With Sheet Input as main sheet And with 12 sheets with a name 1,2,3...................12 This example will look at the date in A1 and copy the whole row in the month sheet Sub copy() Dim sourceRange As Range Dim destrange As Range Dim Lr As Long Dim SHname As String SHname = Month(Sheets("Input").Range("A1").Value) Lr = LastRow(Sheets(SHname)) + 1 Set sourceRange = Sheets("Input").Rows("1:1") Set destrange = Sheets(SHname).Rows(Lr). _ Resize(sourceRange.Rows.Count) destrange.Value = sourceRange.Value End Sub Function LastRow(sh As Worksheet) On Error Resume Next LastRow = sh.Cells.Find(What:="*", _ After:=sh.Range("A1"), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row On Error GoTo 0 End Function -- Regards Ron de Bruin http://www.rondebruin.nl "pauluk " wrote in message ... Hi All, this what i need i have the main sheet, which all the data is placed on to, then sheets for each month, what i want is when data is placed into the main sheet and the date is entered it copies that row into the coresponding sheet. so ie colum f contains the date if it is say 20/7/04 then it copies that row into the next avaible row of the july sheet. Thanks --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I move daily data from one sheet to a 'yearly sheet' | Excel Worksheet Functions | |||
Move data to new sheet - rename sheet based on criteria ? | Excel Discussion (Misc queries) | |||
move rows of data seperated in a sheet to a sheet with no separat | Excel Worksheet Functions | |||
How do I generate a new sheet based on date/week/month? | Excel Worksheet Functions | |||
Macro to move data to different column based on data in another co | Excel Discussion (Misc queries) |