Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default vb code to copy and list selected row to diff sheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default vb code to copy and list selected row to diff sheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how you make links between diff. cells on diff. work sheets NYC-MIKE Excel Worksheet Functions 3 February 11th 08 05:05 PM
Tab Formula from diff sheets Lenard Excel Worksheet Functions 1 December 26th 07 12:20 PM
code to delete sheets not in use based on a cell's drop down list kangasnat Excel Worksheet Functions 2 September 20th 07 03:08 AM
A validated List which link to selected cells according to what is selected on the list WL Excel Worksheet Functions 1 June 5th 06 08:52 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"