Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xls running code according to cnt query

Status
Not open for further replies.

Matsul

IS-IT--Management
May 6, 2002
140
BE
I am running a

select count(*) query from an oracle database. It the count is greater than 0 I carry out further action.

On executing

Set oQt = ActiveSheet.QueryTables.Add( _
Connection:=sConn, _
Destination:=Range("a1"), _
Sql:=rSQL)

oQt.Refresh


I get

COUNT(*)
16

in my active worksheet. Then I would have to read cell A2.

However, is there a way of setting a memory variable to 16 without doing the oQt.Refresh ?

thanks


 
not if you are ysing querytables - can be done with ADO / DAO recordsets if you don't want to write to the workbook thoi....

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top