• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Calendar Control Formula Help

Istiyak

Member
Hi friends,


I have two problems.

1. i have inserted one picture in my excel book when i m clicking on it is showing me caledar which i have added in VBA module.

The query is that i want to popup that calendar with current date. i is not updating every day (Not showing current date by default) i have tried given VBA


Sub Calendar_click()

Calendar.value = today()

range("F3").value = Calendar.value

Unload me

End Sub


Sub ShwClnd()

Calendar.show

End Sub


Kindly resolve


2. I have one cell with formula

=2+2+2+2+3+4+5 {suppose}

Is there any formula which give me the count of no which is in above formula.

i.e. 7 is the result as per above formula.


Waiting.


Regards

!$T!
 
Istiyak


Q1. Which Calendar control are you using ?


Q2. Can you use

=Sum(2,2,2,2,3,4,5) and =Count(2,2,2,2,3,4,5)

Instead?
 
Q1. Your code should be

[pre]
Code:
Sub Calendar_click()
Calendar.value = Date
range("F3").value = Calendar.value
Unload me
End Sub
[/pre]

TODAY() is an Excel function, not VBA.


Q2. Assuming your formula is in A2, you could create an Excel name (Formulas>Name Manager>New), call it formula for instance, with a RefersTo value of =GET.FORMULA($A$2), and then use


=LEN(SUBSTITUTE(Formula,"+",""))-1
 
Hi Hui and xld,


Thanks for response


i m satisfied with answer of question 2 provided by xld becose my software is providing me data in only that manner. Sry hui i m not sable to use SUM() or Count().


Still i m facing issue with the Q1.


I m using Calendar control 11.0 in xl 2003.


Let say


Plz ignore my script or vba.


Provide me fresh VBA so when i m clicking on picture calendar should appear with current date only not any previous or backdate.


plz suggest further.


again thanks to both of u.


Regards

!$T!
 
Back
Top