Copy Range of Data to another Workbook

ststern45

Well-known Member
Joined
Sep 17, 2005
Messages
961
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi everyone,

I have 10 Excel workbooks in a folder C:\States\------.xls

I have 1 Excel workbook named Charts.xls in the same folder.
The worksheet tab is named Workouts

I would like to know if it is possible to:

1. Create a macro that will open a Dialog Box where I can enter the name any 1 of the 10 named workbooks in c:\States folder.

2. Copy and paste a range of cells B6:D100 into the Excel workbook Charts.xls (tab Workouts) cell range B6:D100.



Thanks,

Steve
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Steve, Try below code.. Its pastes the data on new workbook from Cell A1

Sub paste_to_workbook()

Dim spath As String
spath = "c:\states\"
Sheets("workouts").Activate
Range("B6:D100").Select
Selection.Copy
workbook_name = InputBox("Enter the workbook name to paste data")
Workbooks.Open Filename:=(spath & workbook_name)
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End Sub

Hope it helps

Lavan
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top