View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
dim dim is offline
external usenet poster
 
Posts: 123
Default Drawing across Data from different workbook using long list.

I THINK I HAVE IT!! lol :-) But need a little bit of help!

I was reading my last reply and something occured to me!

Instead of using the cell link number to decide which data to copy across
directly into the various different cells, I will simply copy the row of data
from the data workbook into a row on a different sheet in my user interface
book. I can then copy these cells into the sheet with the nice layout. Hence
I only need one set of code going to the sheet with the nice layout because
the same row on the other sheet will have the required info in it! Daa
Daaaa!! ;-)

So....I need to know how to specify a row to copy across...something like
this...would the two bit's with the 'n' work?...I made this up off the top of
my head...

Sub EmployeeData()
Sheets("Calculations").Select
n = (Range("A1").Value)
Workbooks.Open Filename:= _
"C:\Program Files\Book2.xls"
Rows(Cells(n, 1).Value).Copy
Windows("Book1.xls").Activate
Sheets("NewSheet").Select
Rows("2:2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("Book2.xls").Activate
ActiveWorkbook.Close
Windows("Book1.xls").Activate
End Sub