ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_Open Event questions (https://www.excelbanter.com/excel-programming/302564-workbook_open-event-questions.html)

Stuart[_5_]

Workbook_Open Event questions
 
When a workbook opens, I need to do the following:

1) Insert the current date into a cell (H11) in the form
Friday 25th June 2004.

2) Increment the value in cell "J9" by 1, where the J9
value was /1000/ and would become /1001/
(can I do this quickly without using Split?).

Regards and thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004



Bob Phillips[_6_]

Workbook_Open Event questions
 
1) Range("H11").Value = Format(Date,"dddd dd mmm yyyy")

can't get the date suffix (st, th, etc.) without lots of work

2) With Range("J9")
,Value = "/" &Clng(Mid(.Value,2,4))+1 & "/"
End With

All in the WorkbookOpen event in ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
When a workbook opens, I need to do the following:

1) Insert the current date into a cell (H11) in the form
Friday 25th June 2004.

2) Increment the value in cell "J9" by 1, where the J9
value was /1000/ and would become /1001/
(can I do this quickly without using Split?).

Regards and thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004





Stuart[_5_]

Workbook_Open Event questions
 
Many thanks.

Lots of work not required !

Regards.

"Bob Phillips" wrote in message
...
1) Range("H11").Value = Format(Date,"dddd dd mmm yyyy")

can't get the date suffix (st, th, etc.) without lots of work

2) With Range("J9")
,Value = "/" &Clng(Mid(.Value,2,4))+1 & "/"
End With

All in the WorkbookOpen event in ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
When a workbook opens, I need to do the following:

1) Insert the current date into a cell (H11) in the form
Friday 25th June 2004.

2) Increment the value in cell "J9" by 1, where the J9
value was /1000/ and would become /1001/
(can I do this quickly without using Split?).

Regards and thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004



Bob Phillips[_6_]

Workbook_Open Event questions
 
Just spotted a type

2) With Range("J9")
,Value = "/" &Clng(Mid(.Value,2,4))+1 & "/"
End With

should be

2) With Range("J9")
.Value = "/" &CLng(Mid(.Value,2,4))+1 & "/"
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
Many thanks.

Lots of work not required !

Regards.

"Bob Phillips" wrote in message
...
1) Range("H11").Value = Format(Date,"dddd dd mmm yyyy")

can't get the date suffix (st, th, etc.) without lots of work

2) With Range("J9")
,Value = "/" &Clng(Mid(.Value,2,4))+1 & "/"
End With

All in the WorkbookOpen event in ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
When a workbook opens, I need to do the following:

1) Insert the current date into a cell (H11) in the form
Friday 25th June 2004.

2) Increment the value in cell "J9" by 1, where the J9
value was /1000/ and would become /1001/
(can I do this quickly without using Split?).

Regards and thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004





Stuart[_5_]

Workbook_Open Event questions
 
Found it too. No probs.
Regards.

"Bob Phillips" wrote in message
...
Just spotted a type

2) With Range("J9")
,Value = "/" &Clng(Mid(.Value,2,4))+1 & "/"
End With

should be

2) With Range("J9")
.Value = "/" &CLng(Mid(.Value,2,4))+1 & "/"
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
Many thanks.

Lots of work not required !

Regards.

"Bob Phillips" wrote in message
...
1) Range("H11").Value = Format(Date,"dddd dd mmm yyyy")

can't get the date suffix (st, th, etc.) without lots of work

2) With Range("J9")
,Value = "/" &Clng(Mid(.Value,2,4))+1 & "/"
End With

All in the WorkbookOpen event in ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Stuart" wrote in message
...
When a workbook opens, I need to do the following:

1) Insert the current date into a cell (H11) in the form
Friday 25th June 2004.

2) Increment the value in cell "J9" by 1, where the J9
value was /1000/ and would become /1001/
(can I do this quickly without using Split?).

Regards and thanks.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.710 / Virus Database: 466 - Release Date: 23/06/2004




All times are GMT +1. The time now is 04:17 AM.

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