Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cgnotrom - 25 May 2008 02:41 GMT
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
Gary''s Student - 25 May 2008 12:04 GMT
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

Signature

Gary''s Student - gsnu200788

cgnotrom - 25 May 2008 19:37 GMT
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

> Sub copythere()
> Dim s As String
[quoted text clipped - 6 lines]
> r1.Copy s2.Cells(rrow, "F")
> End Sub
Joel - 25 May 2008 12:28 GMT
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

>  Master sheet is named 'Input' data located at L6:n6.
> Child named '11' and data needs to move to F14:h14.
[quoted text clipped - 10 lines]
> Thanks for any help.
> Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.