Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Autofill of single cells

I have a workbook that is read only and needs to have 1 cell autofilled in
with the next ascending number everytime we access the workbook.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Autofill of single cells

Use this
Private Sub Workbook_Open()
If Sheets("Sheet3").Cells(1, 1) < 0 Then
Sheets("Sheet3").Cells(1, 1).Value = Sheets("Sheet3").Cells(1, 1).Value + 1
Else
Sheets("Sheet3").Cells(1, 1).Value = 1
End If
End Sub

To enter this code
Open your workbook
Press ALT-F11 to open VBE
Click on This Workbook under your workbookname
Paste the above macro
Save your workbook, close and open it.
This will increment the no. in A1 of sheet3...
--
Always provide your feedback so that others know whether the solution worked
or problem still persists ...


"Dannie" wrote:

I have a workbook that is read only and needs to have 1 cell autofilled in
with the next ascending number everytime we access the workbook.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default Autofill of single cells

Hi,

I think you need code like this:

Private Sub Workbook_Open()
Dim x As Long
x = Sheets("Sheet1").Range("A1")
Sheets("Sheet1").Range("A1") = x + 1
End Sub

--
Thanks,
Shane Devenshire


"Dannie" wrote:

I have a workbook that is read only and needs to have 1 cell autofilled in
with the next ascending number everytime we access the workbook.

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
I can't autofill cells in a column if blank cells in between SJ Excel Worksheet Functions 1 May 4th 08 01:27 AM
Copy column range of "single word" cells with spaces to a single c nastech Excel Discussion (Misc queries) 3 February 15th 06 05:04 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
autofill cells without a pattern? ryu Excel Discussion (Misc queries) 2 April 11th 05 01:31 PM
Autofill skipping cells Carla Bradley Excel Worksheet Functions 1 November 8th 04 06:20 PM


All times are GMT +1. The time now is 01:20 AM.

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"