Recording a macro gives this:
Application.Run "ATPVBAEN.XLA!Pttestm", , , ActiveSheet.Range("$M$14"), _
False, 0.05
It recorded my output range but not my input ranges.
You may need to search MSDN to find out the correct arguments.
HTH
Graeme
I posted mine before I saw Skip's, and it is of course a much better solution. I've never really looked at subtotal before, but I will now!
Where do I hand my star back? :(
It assumes some familiarity with excel, but other than that you should have no problems. Have you tried recording some simple macros yourself and examining the code that's generated?
Covers everything you could possibly want to know, I think, and mucmore besides! Also have a look at his website:
http://www.j-walk.com/ss/
Also bear in mind there are a great many resources on the web where you can learn for free.....
Graeme
John Walkenbach's Power Programming With VBA is about the best I've seen. The Microsoft Press Step-By-Step Excel Development book isn't too bad.
Graeme
I'm not aware of any way of doing this in Excel. A workround might be to use the Worksheet_Change event to trap any attempt to change cells you want to protect, then warn the user accordingly.
HTH
Graeme
Christer,
Apologies, I misunderstood how you want the masked edit to behave if nothing is entered.
Does this do what you want?
Private Sub Ed1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Ed1.Text = "______-____" Then
'nothing was entered, carry on
ElseIf Not Ed1.Text Like...
Not sure if I understand - do you want the masked edit box to display nothing at all (ie no mask clues) if there isn't an otherwise valid string? For example, from the help:
"To clear the Text property when you have a mask defined, you first need to set the Mask property to an empty string, and...
Will this work, or am I missing something?
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Text <> "" Then
If Not TextBox1.Text Like "######-####" Then
MsgBox ("Wrongly stated!")
Cancel = True
End If
End If
End Sub
As far as I can tell, both methods of selecting item 1 work fine. What code are you then using to return the selected item, and what is the exact error message?
Try removing the Range keyword from your Set lines:
Set rngDAFRPCA = Worksheets("Prepared_Expense").Range("Q6").Offset(1, -15)
Set rngGMPCA = Worksheets("First QT").Range("B4")
Set rngToCopy = Worksheets("First QT").Range("CB5:CE5")
Set rngDestin =...
This works for me (setting ref to Outlook 10.0):
Dim objApp
Dim mi As Outlook.MailItem
Set objApp = CreateObject("Outlook.Application")
Set mi = objApp.CreateItem(olMailItem)
I don't see the CreateItem in your code?
Try something like:
Dim objOutlook As Outlook.Application
Dim olMail As Outlook.MailItem
Set objOutlook = New Outlook.Application
Set olMail = objOutlook.CreateItem(olMailItem)
HTH
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.