View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default can I copy "2" different Ranges from closed workbook (VBA)

You can try this

Because the first range is one row we use offset to go one row down to paste the new data

GetData FName(N), "Billing Sheet", "J42:K43", destrange.Offset(1, 0), False, False


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"DarnTootn" wrote in message ...
I am referencing your
Sub GetData_Example5()
Dim SaveDriveDir As String, MyPath As String
Dim FName As Variant, N As Long
Dim rnum As Long, destrange As Range
Dim sh As Worksheet

"Code was deleted from here down to here"

'Get the cell values and copy it in the destrange
'Change the Sheet name and range as you like
GetData FName(N), "STATS", "A2:AD2", destrange, False, False
GetData FName(N), "Billing Sheet", "J42:K43"<< this is the new
DATA needed......


"Ron de Bruin" wrote:

Hi DarnTootn

Yes that is possible

Post the two ranges then I will reply with a working example
Do you want to copy them (the two ranges) below each other or next to each other.

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"DarnTootn" wrote in message ...
I am using Ron DeBruins code to accomplish my original task. (works great)
http://www.rondebruin.nl/copy1.htm#workbook
But recently more data is needed from a second sheet within the same
workbook(s) that I am retreiving my data from. Is there a way to add code
to this example to include a second range of data from the same workbook?

Thank you in advance for the help....