Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
col heading help | Excel Worksheet Functions | |||
how can I exclude a heading but show that heading in sheet. | Excel Discussion (Misc queries) | |||
In a table produce an value by column heading and row heading | Excel Worksheet Functions | |||
Heading | Excel Discussion (Misc queries) | |||
Insert a heading | Excel Programming |