Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default ADO Recordset include Field names

How do I modify this code to get the Field names from rec6 to start in column
13? They currently start in column 1, and I've tried modifying it several
ways - so far no luck.

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default ADO Recordset include Field names

try it this way:

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol+12).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6


--
Hope that helps.

Vergel Adriano


"Kirk P." wrote:

How do I modify this code to get the Field names from rec6 to start in column
13? They currently start in column 1, and I've tried modifying it several
ways - so far no luck.

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default ADO Recordset include Field names

Perfect, thanks!

"Vergel Adriano" wrote:

try it this way:

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol+12).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6


--
Hope that helps.

Vergel Adriano


"Kirk P." wrote:

How do I modify this code to get the Field names from rec6 to start in column
13? They currently start in column 1, and I've tried modifying it several
ways - so far no luck.

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Include Field Names - check box not available in Excel 2007 Kimo Excel Discussion (Misc queries) 0 April 18th 09 09:22 PM
Excel 2007 - Include Field Names KJKJKJKJ Excel Discussion (Misc queries) 0 July 29th 08 08:00 PM
Error opening recordset where table is empty (but has field names) - How do I avoid? Alan Excel Programming 1 October 10th 05 07:43 AM
ADO cloned recordset doesn't return field names quartz[_2_] Excel Programming 3 March 16th 05 09:49 PM
DAO query/recordset returns with field names Seth[_4_] Excel Programming 0 August 18th 03 08:36 PM


All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"