Data Allocate problem

  • Thread starter vanessa via OfficeKB.com
  • 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
 
V

vanessa via OfficeKB.com

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top