ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   grab values from a range (https://www.excelbanter.com/excel-programming/391392-grab-values-range.html)

xrbbaker

grab values from a range
 
I need to put together some VBA that will do this.

1) Copy the cell values of a named range from another workbook to this
workbook, starting in current cell.

2) I will then duplicate that code to create a second macro, but in the
second macro I'm going to replace the value in column m with a formula. I
think I can figure that part out if I can get the first chunk. Any help
appreciated.

thx - Russ

merjet

grab values from a range
 
Sub Macro1()
Workbooks("OtherWb").Sheets("Sheet1").Range("MyRan ge").Copy _
ActiveCell
End Sub

Hth,
Merjet



xrbbaker

grab values from a range
 
Thanks Merjet!

"merjet" wrote:

Sub Macro1()
Workbooks("OtherWb").Sheets("Sheet1").Range("MyRan ge").Copy _
ActiveCell
End Sub

Hth,
Merjet




xrbbaker

grab values from a range
 
Merjet,

Must the workbook be open? I'm using

Sub GetPlaybookData()
Workbooks("H:\IT Process Engineering Artifacts\Practice Area\CF
Playbook.xls").Sheets("Project Staffing").Range("Desired_Staffing2").Copy
ActiveCell
End Sub

and I keep getting subscript out of range. I googled that and it looks like
that would likely mean that something isn't there that I think is there.
This file, worksheet and range definitely exist. Any ideas? -thx
"merjet" wrote:

Sub Macro1()
Workbooks("OtherWb").Sheets("Sheet1").Range("MyRan ge").Copy _
ActiveCell
End Sub

Hth,
Merjet




merjet

grab values from a range
 
Yes, the workbook must be open for the code I gave you to work. If you
want to do it with a closed workbook, search this group for "closed
workbook".

Merjet




All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com