Macro to copy from one source sheet to numerous destination sheets

  • Thread starter Thread starter msdrolf
  • Start date Start date
M

msdrolf

Each row in my source worrksheet has data to be entered into many destination
worksheets. I have tried the following:

Windows(Source).Activate
Range(row, 2).Select
Selection.Copy
Windows(dept & ".xls").Activate
Worksheets("Info").Activate
Range("C3").Select
ActiveSheet.Paste

My problem is that the "Range(row,2).select" command does not work. Can
someone provide me with a command line which would work. Thanks
 
You sould always qualify any Range() reference with the containing worksheet
(and that with its workbook)
That removes all ambiguity and the source of many bugs.
It's not clear from your code which worksheet in the "source" workbook will
be copied from, but something like this should work. Note use of Cells()
for the source range.

'**************************
dim rng Src as range, rngDest as range

set rngSrc=Workbooks(Source).worksheets("whatever").cells(row, 2)
set rngDest=workbooks(dept & ".xls").worksheets("Info").Range("C3")

rngSrc.copy rngDest
'**************************

Tim
 
Back
Top