View Single Post
 
Old 03-26-2013, 11:46 PM
ganeshm ganeshm is offline Windows XP Office 2007
Novice
 
Join Date: Mar 2013
Posts: 1
ganeshm is on a distinguished road
Default link excel to word

Hi Experts,

I have a formula from excel, which retrieves sheet 2 data to sheet 1 with the use of activex control (form control) button.

But i want to make a command button in word and link to excel to retrieve data.

Coding is below:

Code:
Sub LoadData()
Dim rng As Range
Sheets("Sheet1").Range("A4:A14").Clear
Set rng = Sheet2.Cells(1, 1).CurrentRegion
With rng
  .AutoFilter 4, Sheets("Sheet1").Buttons(Application.Caller).Caption
  .SpecialCells(12).Copy Sheets("Sheet1").Range("A4")
  .AutoFilter
End With
End Sub
Kindly verify this and suggest me.
Reply With Quote