Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default table of contents

How can i make table of contents for 15000 row, for example
year 2001
row 1

year 2002
row 5000

year 2003
row 10000



I'm going to assume that your main sheet looks something like this:

A B C
2001 Data Here
2001 Data Here
2001 Data Here
2002 Data Here
2002 Data Here
2003 Data Here
2003 Data Here
2003 Data Here

With your main sheet called "MAIN", and contents sheet called "CONTENTS"

dim entryRow as long
dim dataRow as long
dim lastYear as long
dim thisYear as long
dim lastRow as long

entryRow = 1
lastYear = 0

lastRow = Sheets("MAIN").Range("A:A").Count

for dataRow = 1 to lastRow
thisYear = Sheets("MAIN").Cells( dataRow, 1).Value
if thisYear<lastYear then
Sheets("CONTENTS").Cells( entryRow, 1).Value = "Year " + Format(
thisYear)
Sheets("CONTENTS").Cells( entryRow + 1, 1).Value = dataRow
lastYear = thisYear
entryRow = entryRow + 3
endif
next


Iain King


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
Table of Contents? Penny Excel Discussion (Misc queries) 3 March 10th 09 08:55 PM
TABLE OF CONTENTS BG Excel Discussion (Misc queries) 1 March 22nd 08 01:27 AM
Table of contents Funkyfido Excel Worksheet Functions 3 August 31st 07 10:43 AM
Table of Contents Deb Excel Discussion (Misc queries) 1 March 28th 07 09:23 PM


All times are GMT +1. The time now is 11:59 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"