ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Formula (https://www.excelbanter.com/excel-programming/300458-help-formula.html)

Mjohnson

Help with Formula
 
I know there has to be an easy way to do this. I have a
spreadsheet that I need to update on a weekly basis. All
the report weeks are in 1 column and they need to be
updated to increase by 1 each time I update the sheet.
Is there an easy way to write a macro to update the cell
to increase by 1.

Ex.
Field A Field B
Mail Date Report Week
05.14.04 3
03.31.04 9
03.17.04 11

I want it to update to 4, 10, and 12

Thanks!

david mcritchie

Help with Formula
 
Hi MJohnson.........,
What about the data that is already in the spreadsheet
including the information in Column A.

To replace the numbers in Column B are there just 3 or do you
have a years worth.

Sub Mjohnson_Add1_toB()
Dim cell As Range
For Each cell In Columns("B:B").SpecialCells(xlConstants, xlNumbers)
cell = cell + 1
Next cell
End Sub

Since you posted something (blank question) in another newsgroup.
I'll include -- If not familiar with macros see
http://www.mvps.org/dmcritchie/excel/getstarted.htm

You can do this manually by typing a 1 into a cell , selecting it,
then copying it.
Then Selecting Column B, Edit, Paste Special, Add
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Mjohnson" wrote in message ...
I know there has to be an easy way to do this. I have a
spreadsheet that I need to update on a weekly basis. All
the report weeks are in 1 column and they need to be
updated to increase by 1 each time I update the sheet.
Is there an easy way to write a macro to update the cell
to increase by 1.

Ex.
Field A Field B
Mail Date Report Week
05.14.04 3
03.31.04 9
03.17.04 11

I want it to update to 4, 10, and 12

Thanks!





All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com