Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am working with workbook with 30sheets for each day x each worksheet having
same headers and colmuns x I want to copy selected rows to corresponding sheets with different name . eg. date name details amount type 13feb kk ccj/dxb 1300 inv 14feb pv ccj/auh 1200 alh I would like to copy first row to a sheet named inv and second row to sheet names alh. can u adv me the code to be used -- pvkkutty new to discussion group however a freequent reader of discussion group posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try the below code with all the sheets...
Sub CopyRowstoDifferentSheets() Dim wb As Workbook, ws1 As Worksheet, ws2 As Worksheet Dim lngRow As Long, lngLastRow1 As Long, lngLastRow2 As Long Set wb = ActiveWorkbook: Set ws1 = wb.ActiveSheet lngLastRow1 = ws1.Cells(Rows.Count, "E").End(xlUp).Row For lngRow = 2 To lngLastRow1 Set ws2 = wb.Sheets(CStr(ws1.Range("E" & lngRow))) lngLastRow2 = ws2.Cells(Rows.Count, "E").End(xlUp).Row ws1.Rows(lngRow).Copy ws2.Rows(lngLastRow2 + 1) Next End Sub -- Jacob "pvkutty" wrote: I am working with workbook with 30sheets for each day x each worksheet having same headers and colmuns x I want to copy selected rows to corresponding sheets with different name . eg. date name details amount type 13feb kk ccj/dxb 1300 inv 14feb pv ccj/auh 1200 alh I would like to copy first row to a sheet named inv and second row to sheet names alh. can u adv me the code to be used -- pvkkutty new to discussion group however a freequent reader of discussion group posts |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how you make links between diff. cells on diff. work sheets | Excel Worksheet Functions | |||
Tab Formula from diff sheets | Excel Worksheet Functions | |||
code to delete sheets not in use based on a cell's drop down list | Excel Worksheet Functions | |||
A validated List which link to selected cells according to what is selected on the list | Excel Worksheet Functions | |||
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? | Excel Worksheet Functions |