Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm pulling data into an excel spreadsheet and this works fine, however I was
unable to figure out how to get the table coulmn headings from the table. Here is the Snippet I am using to get the data and write the output. Can someone help? objCN.Open strConn ' Create a recordset object. Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset With rs ' Assign the Connection object. .ActiveConnection = objCN ' Extract the required records. .Open "SELECT * FROM MyTable" ' Copy the records into cell A1 on Sheet1. Sheet1.Range("A2").CopyFromRecordset rs ' Tidy up .Close End With objCN.Close Set rs = Nothing Set objCN = Nothing |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA: Column Select then Data Select then return to cell A1 | Excel Discussion (Misc queries) | |||
select a column, then add rows of each column | Excel Discussion (Misc queries) | |||
how to select a single column when this column cross a merged cell | Excel Programming | |||
Shortcut to select column with data in previous column | Excel Discussion (Misc queries) | |||
select detail in column B if column A = date | Excel Worksheet Functions |