Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 06-03-2018, 08:43 AM
NoSparks NoSparks is offline Copy two separate ranges from another workbook Windows 7 64bit Copy two separate ranges from another workbook Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Couple of options...
easiest to understand is copy and paste as values
Code:
range1.Copy
  yourdestinationsheet.Range("A2").PasteSpecial (xlPasteValues)
more difficult to understand is to use an array
Code:
arr = range1.value
  yourdestinationsheet.Range("A2").Resize(UBound(arr, 1), UBound(arr, 2)) = arr
If you put the formula that's wanted into H2 and make it the active cell,
then go to the Immediate window, Ctrl + g, from the VBE, type in
? activecell.formulaR1C1
hit enter and you will see what Excel sees as being the formula in that cell
include H2 in the autofill range
Code:
  Range("H2").FormulaR1C1 = "=xxx"
  Range("H2").AutoFill Destination:=Range("H2:H" & lastrow)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy data as well as formatting from one workbook to another. LearnerExcel Excel 1 03-10-2018 01:35 PM
Copy from one workbook to another MartinExcel11 Excel Programming 1 03-28-2017 09:49 AM
Copy two separate ranges from another workbook Take String of numbers, expand ranges, sort, then compress back into ranges AustinBrister Word VBA 19 08-22-2016 05:18 PM
How to make a shared workbook and allow user to edit ranges prdecina Excel 1 07-25-2016 11:42 PM
Copy two separate ranges from another workbook Storing and retreiving text from a separate workbook Benjamin92 Excel Programming 4 03-08-2015 04:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft