View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Atishoo Atishoo is offline
external usenet poster
 
Posts: 267
Default Auto Import From Other Doc

how about copying selected range and pasting it into the new doc via a
command button.

Go view-toolbars-control toolbox: click design mode then command button,
click where you want the buttton placed on your worksheet, while still in
design mode double click the command button this will open the vb editor
paste the following in the


Private Sub CommandButton1_Click()

Workbooks("book1").Worksheets("Sheet1").Range("C1: C5").Copy
ActiveSheet.Paste
Destination:=Workbooks("book2").Worksheets("Sheet1 ").Range("c1:c5")
CutCopyMode = False

End Sub

obviously replace your names for workbooks and worksheets and ranges in the
above code.
Close the ditor and click to exit design mode.
Your command button should now copy and paste from one workbook to another.

"Gazz_85" wrote:

What code would i have to put in so that everytime you clicked a button a
macro would automatically pull data from another excel sheet and drop it into
my workbook so i can do calculations with it???

Cheers