Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dd dd is offline
external usenet poster
 
Posts: 95
Default Copy specific data over to other worksheet

I have received an excel document as a 150 page manual. Each page is setup
as a proforma, containing the same headings, tables etc. although the tables
have different amounts of rows. I want to make this data more user friendly,
rather than havingto troll through the pages to find the required
information.

I have created a new worksheet with headings and, in order to copy the
information from the titles, i.e.
A1 B1
Element Windows
Feature Timber Frames
I think it needs to do the following:

For each cell in worksheet
If cell value="Element"
Copy next cell (right of) to sheet 2, column 1, row 2

Next cell - if cell value -"Element" copy to sheet 2, column 1, row 3 and
so on.


Regards
Dylan DAwson


  #2   Report Post  
Posted to microsoft.public.excel.programming
dd dd is offline
external usenet poster
 
Posts: 95
Default Copy specific data over to other worksheet

John

Much appreciated, your code did exactly what I wanted and I have rated your
post as helpful, thank you.
I have now populated the first theree columns on Sheet2 with my data.

My next task is to copy over the data from the tables in sheet 1. The first
column in my table has the heading "Attribute". It can have a from 3 to 12
row entries. Can I use your code to look for the heading "attribute" and
then create a list from the contents of the rows below (until it reaches a
blank cell perhaps) and paste the list of entries into the relevant cell in
Sheet 2, column D?

Regards
Dylan Dawson

"John Bundy" wrote in message
...
Made as a button, change myRow or array as needed:

Private Sub CommandButton1_Click()

Dim myRow As Integer
Dim lastRow As Integer
Dim iArray(10000, 2) As Variant
Dim iIndex As Integer

iIndex = 1
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
myRow = 1

For i = 1 To lastRow
If Cells(myRow, 1) = "Element" Then _
'populate array
iArray(iIndex, 1) = Cells(myRow, 1)
iArray(iIndex, 2) = Cells(myRow, 2)
iIndex = iIndex + 1
End If
myRow = myRow + 1
Next
iIndex = 1
myRow = 2
Sheets("sheet2").Select

Do Until iArray(iIndex, 2) = ""
Sheets("sheet2").Cells(myRow, 1) = iArray(iIndex, 2)
iIndex = iIndex + 1
myRow = myRow + 1
Loop

End Sub

--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"dd" wrote:

I have received an excel document as a 150 page manual. Each page is setup
as a proforma, containing the same headings, tables etc. although the
tables
have different amounts of rows. I want to make this data more user
friendly,
rather than havingto troll through the pages to find the required
information.

I have created a new worksheet with headings and, in order to copy the
information from the titles, i.e.
A1 B1
Element Windows
Feature Timber Frames
I think it needs to do the following:

For each cell in worksheet
If cell value="Element"
Copy next cell (right of) to sheet 2, column 1, row 2

Next cell - if cell value -"Element" copy to sheet 2, column 1, row 3 and
so on.


Regards
Dylan DAwson





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
Copy specific data to second worksheet Andre7266 New Users to Excel 4 May 13th 08 08:39 PM
Copy specific records from a worksheet to another Irfan Excel Worksheet Functions 3 January 29th 08 05:36 PM
copy specific records to new worksheet violet Excel Programming 1 September 22nd 06 01:31 PM
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
Copy and pasting specific sheet data to a master worksheet simora Excel Programming 4 May 9th 05 05:30 AM


All times are GMT +1. The time now is 03:20 AM.

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"