View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Increasing the value of a cell by one per worksheet?

You should look closely at solutions that loop
for each sh in worksheet
or
for i = 1 to worksheets.count

type loops.

if you have a worksheet named Index, then if it is at the front, all the
numbers will be off by 1 and you will process the index sheet as well.

Just a thought.

I suppose you could do

for each sh in worksheets
if lcase(sh.name) < "index" then
sh.Range("F1").Value = clng(sh.name)
end if
worksheets("Index").cells(clng(sh.name _
),"B").Value = sh.Range("A1").Value
next



--
Regards,
Tom Ogilvy

wrote in message
ups.com...
Hello all,

I'm new to excel programming.

I'm working with a large workbook (over 200 sheets) and I need to
input a number into the same cell (F1) in every sheet. I need sheet
001 to display "1" (no quotes) in F1, and sheet 002 to display "2",
003 to display 3, all the way to sheet 200 displaying '200'. What
formula can I use to achieve this output?

Another thing I need to do is come up with a function that takes a
number value in a cell in one sheet (one of the sheets named 001, 002,
003, etc.) and places it in a specific cell in, let's say, the "INDEX"
sheet. But I need the output cell in the "INDEX" sheet to be
different for every 001 002 003 004 sheet. Let's say I need the
number from cell A1 from every sheet, but I need each sheet to display
their respective A1's in a different cell in the INDEX sheet.

Yeah, it's confusing me. Thanks in advance.