Data Allocate problem

  • Thread starter Thread starter vanessa via OfficeKB.com
  • Start date Start date
V

vanessa via OfficeKB.com

i face the data allocate problem, i dun want place all the results in only
Range("A1"), but i hope can put each results in selected location in excel
sheet. please help........this is my coding in VBA:

Private Sub cmdGet_Click()

sqlstring = "select count(price) from tbl_request group by price"

connstring = _
"ODBC;DSN=BBI;UID=;PWD=;Database=BBIPROD"

With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range
("A1"), Sql:=sqlstring)
.Refresh
End With

End Sub
 
vanessa said:
i face the data allocate problem, i dun want place all the results in only
Range("A1"), but i hope can put each results in selected location in excel
sheet. please help........this is my coding in VBA:

Private Sub cmdGet_Click()

sqlstring = "select count(price) from tbl_request group by price"

connstring = _
"ODBC;DSN=BBI;UID=;PWD=;Database=BBIPROD"

With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range
("A1"), Sql:=sqlstring)
.Refresh
End With

End Sub



i settled liao.....thank all.
 
Back
Top