Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically copy data to second worksheet

Status
Not open for further replies.

CutterJaxx

Technical User
Sep 17, 2008
8
AU
Hi all,

Running Windows XP, Excel 2003

I have a workbook which has multiple pairs of worksheets. In each pair their is a data sheet and a sheet which contains corresponding pictures.

Each record in the data sheet may have anywhere from 1 to 4 pictures associated with it.

DataSheet
In column B of the data sheet is a unique item number, column C is a description/text field and columns D E F & G contain picture number.

Picture Sheet
At intervals of every 45 rows a picture has been inserted in the picture sheet.


I need the Item No(Column B),Description(Column C) and Picture Number(Columns D-G) copied into the picture worksheet the same number of times as there are picture numbers entered for that record. And I want this to happen automatically(ideally as each pic number is entered a copy is placed in the next location in the picture sheet) or via a triggered macro.

Is this possible???

Thanks in advance

Cutter
 
SkipVought,

Thanks for that precise and focused answer to my question, what I should have said was could someone please point me in the right direction as to how this could be done.

Thanks
Cutter
 



How are the sheets paired?

How is the data mapped from the data sheet to the picture sheet?

I would assume that the Picture ID is the shape name. Am I correct?

Knowing what little we know, I'd suggest looping thru the data something like this...
Code:
dim r as range, c as range
with wsData.UsedRange
  for each r in wsData.Range(Cells(.row, "B")Cells(.rows.count+.row-1, "B")
    for each c in wsData.Range(r, r.end(xltoright))
      select case c.column
         case 2:    'this is the ITEM
         case 3:    'this is the DESC
         case else: 'these are the pic names
      end select
      icol = icol+1
    next
end with


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top