LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default No Heading Row

For some practice with Word, I created a very simple spreadsheet that
contained a 3 x 3 cell range that I named "mySSrange"

In the cells I entered:

Cat Dog Hampster
Cow Pig Sheep
Wolf Badger Bear

When I run this code the first message displayed is "Cow." It seems
that Excel is making my first row a heading or something. How do I
modify this code or my spreadsheet so that the default A B C is
the heading and all rows of data I enter are treated as data and not a
heading. Thank you.

Sub ScratchMacro()
'Set Reference to "Microsoft DAO 3.51 (or 3.6) Object Library".
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Long
Set db = OpenDatabase("C:\Book1", False, False, "Excel 8.0")
Set rs = db.OpenRecordset("SELECT * FROM `mySSRange`")
'Loop through each recordset.
While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
MsgBox rs.Fields(i).Value
Next i
rs.MoveNext
Wend
'Clean up.
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Sub

 
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
col heading help Norvin Excel Worksheet Functions 2 January 11th 08 04:27 PM
how can I exclude a heading but show that heading in sheet. Hunter Excel Discussion (Misc queries) 4 January 8th 07 07:35 AM
In a table produce an value by column heading and row heading naflan Excel Worksheet Functions 1 December 27th 05 05:18 PM
Heading switchead Excel Discussion (Misc queries) 1 November 14th 05 07:32 PM
Insert a heading dht[_2_] Excel Programming 2 August 17th 04 03:47 PM


All times are GMT +1. The time now is 07:57 PM.

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

About Us

"It's about Microsoft Excel"