Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Filling rows

The worksheet where the data is residing is called "Master
Employee" and I need to copy every row onto a worksheet
called "Labels". Every row copied will fill in 10 rows on
the "labels" worksheet. Both the wkshts have the same
column headings.

I have data on Master Employee and need to copy to Labels.
Master Employee!A1 to A1:A10 on Labels
Master Employee!A2 to A11:A20 on Labels
Master Employee!A3 to A21:A30 on Labels
Master Employee!A4 to A31:A40 on Labels
and so on.

Help!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Filling rows

I'm not sure exactly what you wanted. So, I created two
varieties.

I think you want the second variety. Check and see if one
of these work for you. I didn't completely check them,
but I think they're OK. Note, for these samples, the
first row is 1 and the last row is 10 in the Master
Employees sheet. Just change these variables to fit your
requirements.

The first variety allows for 10 columns (fields) of data
per row, in the Master Employee sheet. These are copied
to the Labels sheet in column A in groups of 10.

The second variety allows for only one column of data
(column A) in each row as found on the Master Employee
Sheet. This one item is copied to the Labels sheet in
groups of 10 also.

Sub EmployeeLabelsVar1()
Dim i As Long
Dim j As Byte
Dim FirstRow As Integer, LastRow As Integer
Dim S1 As Worksheet, S2 As Worksheet
Dim Count As Integer

Set S1 = Sheets("Master Employee")
Set S2 = Sheets("Labels")

FirstRow = 1
LastRow = 10

Count = 0


For i = FirstRow To LastRow
For j = 1 To 10
S2.Cells(j + Count, 1).Value = _
S1.Cells(i, j).Value
Next j
Count = Count + 10
Next i

End Sub

Sub EmployeeLabelsVar2()
Dim i As Long
Dim j As Byte
Dim FirstRow As Integer, LastRow As Integer
Dim S1 As Worksheet, S2 As Worksheet
Dim Count As Integer

Set S1 = Sheets("Master Employee")
Set S2 = Sheets("Labels")

FirstRow = 1
LastRow = 10

Count = 0


For i = FirstRow To LastRow
For j = 1 To 10
S2.Cells(j + Count, 1).Value = _
S1.Cells(i, 1).Value
Next j
Count = Count + 10
Next i

End Sub

-----Original Message-----
The worksheet where the data is residing is

called "Master
Employee" and I need to copy every row onto a worksheet
called "Labels". Every row copied will fill in 10 rows on
the "labels" worksheet. Both the wkshts have the same
column headings.

I have data on Master Employee and need to copy to

Labels.
Master Employee!A1 to A1:A10 on Labels
Master Employee!A2 to A11:A20 on Labels
Master Employee!A3 to A21:A30 on Labels
Master Employee!A4 to A31:A40 on Labels
and so on.

Help!!

.

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
filling a single cell before the sum of the previous rows. Edward Letendre Excel Discussion (Misc queries) 6 July 28th 08 04:55 PM
FILLING A RANGE WITH SAME CHARACTERS INVOLVING HIDDED ROWS CCCN_PARTNER Excel Discussion (Misc queries) 1 September 17th 07 06:38 PM
Filling only cells for rows with content Colin Hayes Excel Worksheet Functions 1 April 28th 07 02:46 PM
Filling in blank rows Jenny B. Excel Discussion (Misc queries) 3 December 18th 06 02:50 PM
auto filling columns from rows Ken Excel Discussion (Misc queries) 2 February 23rd 05 09:49 AM


All times are GMT +1. The time now is 09:46 PM.

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

About Us

"It's about Microsoft Excel"