Need a macro to Copy data from one sheet and paste to child

C

cgnotrom

Master sheet is named 'Input' data located at L6:n6.
Child named '11' and data needs to move to F14:h14.
macro need to select proper child sheet by adding (D4*10+D6) = 11
and the proper line on child by value stored at D3 = 1 as the child has a
column
begining at C14:C49 with values 1 thur 36. Data would be pasted always to
the
F:H array.
Child sheets would be numbered from 11 to 13 and expanded later.
The D6 cell would be numbered from 1 to 3 indicating week number and
expanded later.
Using 2007
Thanks for any help.
Chris
 
G

Gary''s Student

Sub copythere()
Dim s As String
Set s1 = Sheets("Input")
Set r1 = Sheets("Input").Range("L6:N6")
n = 10 * s1.Range("D4").Value + s1.Range("D6").Value
s = n
Set s2 = Sheets(s)
rrow = s1.Range("D3")
r1.Copy s2.Cells(rrow, "F")
End Sub
 
J

Joel

Sub MoveData()

With Sheets("Input")
ShtNum = (10 * .Range("D4")) + .Range("D6")
Set Childsht = Sheets(Trim(CStr(ShtNum)))
RowNum = .Range("D3")
.Range("L6:N6").Copy _
Destination:=Childsht.Range("F" & RowNum)
End With

End Sub
 
C

cgnotrom

Thankyou so much. This will give me a great start into programming
Now I have 2 sub's that do the same thing. I must learn how all this is done.
I have been reading re macros but its slow from the page to the brain!
Again Thankyou
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top