hi
you need to select a cell inside the query range.....
Private Sub CommandButton1_Click()
sheets("sheet1").activate
Range("A2").QueryTable.Refresh BackgroundQuery:=False
end sub
regards
FSt1
"cbrammer" wrote:
We are moving data from a database to Excel. We need the Excel spreadsheet to
update as we make changes in the database. What I need is to put a 'button'
on the spreadsheet that will refresh the data as we make changes in the
database. I know I need to code it in VB. Can anyone lead in me in a
direction? Thanks.