View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default parent/child ranges

#1 question - does VBA automatically know that the 1st workbook (that
contains the sub) is the parent, & subsequent workbook(s) opened are
the child?? or do i have to tell it that?

i have a large list of non-contiguous range data that needs to be
transferred between 2 workbooks (from parent to child). parent &
child's set-ups are NOT similar.

i tried this approach, first...
Sub testing()
'wb = ezmarkbook
'ws = ezmarkbook.dataentry.page
'newwb = student profile
'newws = student profile.unit page

Set wb = ActiveWorkbook
Set ws = ActiveSheet

Workbooks.Open Filename:="F:\Susan\SchoolProject.xls"

Set newWB = ActiveWorkbook
Set newWS = ActiveSheet

Call copy

End Sub



Public Sub copy()

Set rHere = wb.ws
Set rThere = newWB.newWS

rThere.Range("h8") = rHere.Range("f3")
rThere.Range("c7") = rHere.Range("e3")

col.copy Destination:=myNewRange

End Sub


obviously, this doesn't work. you can see that i was trying to
shorten the amount of typing i would have to do. maybe they should be
sThere & sHere???

rThere.range instead of newwb.newws.range

but like i said, it isn't working. in researching it i stumbled
across the parent-child concept.

there is no rhyme or reason for making a for-each-next loop, so i'll
have to tell each range specifically where it goes. could somebody
please give me some direction on if this is possible to shorten up or
not?
thanks a lot!
susan