This one works perfect!
Thx!
This one works perfect!
Thx!
Doesn't work either... :?
Thx in Advance!
StrongSteve
I tried the formula, but in a way it does not work, and futhermore I do not understand it... sorry to say!
any ideas?
thx in advance!
Stef
Hi everybody!
The Definition of HLOOKUP is:
If HLOOKUP can't find lookup_value, and range_lookup is TRUE, it uses the largest value that is less than lookup_value.
What I need is HLOOKUP to return the next value, that is larger than the lookup_value.
For example if I have row like: 10 - 20 - 30 and the lookup value is 17, HLOOKUP will return 10, I need it to return 20.
How do I do this?
Thx in Advance!
StrongSteve
Hi everybody!
This question is not 100% linked to MS Excel, but as I like Ozgrid.com so much, I thaugt someone will know an answer to my "tricky" problem.
Currently I am writing a macro for MS Outlook. It analyses incoming mails and if the subject is Appointment: 01.01.2005 18:00; 02.01.2005 14:00; "Test Appointment"; "At Home" for example, the macro automatically creates a new appoinment with the values, specified in the subject and adds it to the calendar.
The macro works fine if the new mails come to the standard inbox folder.
The only problem is, my new mails come via IMAP and are saved in an imap folder...something like: "mails.imapdomain.at" and there is a folder called "inbox.imapdomain.at".
How can I go through all mails in this folder?
Sure I could create a rule, moving all mails to the standard input folder, but it seems to be quite a workaround, and there has to be another way to do this...
Any ideas?
Thx in Advance!
Stef
My SourecCode so far:
'Analyse all Mails in Inbox
Sub AnalyseIncomingMails()
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object
Dim subject As String
'The NameSpace is the object that gives you access to all Outlook's folders.
'In Outlook there is only one and it is called "MAPI" which is an acronym
'for Messaging Application Programming Interface.
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
'Only check messages, if Inbox is not empty
If (Inbox.Items.Count > 0) Then
For Each Item In Inbox.Items
subject = Item.subject
If (InStr(LCase(subject), "appointment:") = 1) Then
SaveAppointment (subject)
Item.Delete
ElseIf (InStr(subject, "Task:") = 1) Then
SaveTask (subject)
Item.Delete
End If
Next Item
End If
End Sub
'Save a new appointment to the calendar
Sub SaveAppointment(ByRef subject As String)
Dim outlookApp As Application
Dim appItem As AppointmentItem
Dim appList As Variant
Dim i As Integer
Set outlookApp = CreateObject("Outlook.Application")
Set appItem = outlookApp.CreateItem(olAppointmentItem)
'Start and End like "01/01/2004"
'Subject like "Meeting with Carl"
'Location like "Somewhere"
'Remove the String "Appointment: " from the Email Subject
subject = Replace(subject, "appointment: ", "")
subject = Replace(subject, "Appointment: ", "")
appList = Split(subject, ";")
'Save Attributes to the new appointment
On Error Resume Next
With appItem
For i = 0 To UBound(appList)
Select Case i
Case 0 'Save Start Date
.start = Replace(appList(i), ".", "/")
Case 1 'Save End Date
.End = Replace(appList(i), ".", "/")
Case 2 'Save Subject
.subject = appList(i)
Case 3 'Save Location
.Location = appList(i)
Case 4 'Set Reminder? When?
If (appList(i) <> "") Then
.ReminderMinutesBeforeStart = appList(i)
End If
Case 5 'Body of Appoinment
.Body = appList(i)
End Select
Next i
End With
On Error GoTo 0
'Save the new Appointment to the calendar
appItem.Display
'appItem.Save
End Sub
'Save a new task to the calendar
Sub SaveTask(ByRef subject As String)
Dim outlookApp As Application
Dim tskItem As TaskItem
Dim tskList As Variant
Dim i As Integer
Set outlookApp = CreateObject("Outlook.Application")
Set tskItem = outlookApp.CreateItem(olTaskItem)
'Start and End like "01/01/2004"
'Subject like "Meeting with Carl"
'Location like "Somewhere"
'Remove the String "Appointment: " from the Email Subject
subject = Replace(subject, "task: ", "")
subject = Replace(subject, "Task: ", "")
tskList = Split(subject, ";")
'Save Attributes to the new appointment
On Error Resume Next
With tskItem
For i = 0 To UBound(tskList)
Select Case i
Case 0 'Save Due To Date
.DueDate = Replace(tskList(i), ".", "/")
.startDate = Now
Case 1 'Save Subject
.subject = tskList(i)
Case 2 'Body of Appoinment
.Body = tskList(i)
End Select
Next i
End With
On Error GoTo 0
'Save the new Appointment to the calendar
tskItem.Display
'tskItem.Save
End Sub
Display More
and within the "ThisOutlookSession":
hi everybody!
I finally managed, creating buttons at runtime!
now i want to add a picture to these buttons, but the following fragement does not work... it says "Type-mismatch" for the picture line... everything else is correct...
why?
Set buttonDrawing(i).button = frmMain.Controls.Add("Forms.CommandButton.1", drawings(i), True)
buttonDrawing(i).button.Left = 340
buttonDrawing(i).button.top = top
buttonDrawing(i).button.width = 20
buttonDrawing(i).button.Height = 20
buttonDrawing(i).button.Caption = "B"
buttonDrawing(i).button.Picture = "C:\plan.ICO"
is there a way to create an invisble button and inherit its icons, events, ... to the other buttons? because otherwise the icon will not be saved...
thx in advance!
stef
hi roy!
basically a good idea, but not if you read in a textfile and build a menu according to it, havin a range of 0 to 1000 entries...
thx anyway!
stef
Hi everybody!
I have a UserForm in which I add control elements (labels, textboxes) at runtime.
Now I need to add buttons too. I can already add the buttons to the userform, but the problem is... I need an click-Event for all the buttons.
It would be fine to "fire" the same event for all buttons (so i click button A same event is called as clicking on button C)....
Can you please tell me how?
Thx in Advance!
stef
Sorry Dave, seems we both posted at the same time!
Picture Viewer Finished...
Hi everybody!
Thanks to your help, I finally finished my prototype of a picture viewer.
Specifications:
Perhaps someone needs it!
Hope it helps!
Stef
P.S.: Sorry Tooltips are in German!
Hi everybody!
I am displaying images in an imageBox. I use mode zoom, to fit their size to the imagebox.
Now i want to be able to zoom the picture manually and to move it around in the imagebox?
how do i start? anyone knowing a page explaining this?
Thx in Advance!
Stef
Where is your post man (or woman)?
This should solve your problem:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim valueOfB3 As Integer
valueOfC3 = Range("C3").Value
'Value of C3 has to be 12, 24 or 36
If ((valueOfC3 <> 12) And (valueOfC3 <> 24) And (valueOfC3 <> 36)) Then
MsgBox ("Value of C3 has to be 12, 24 or 36!")
End If
'Calculate the value for D4
If (valueOfC3 = 12) Then
Range("D4").Value = Range("B3") * Range("A1")
ElseIf (valueOfC3 = 24) Then
Range("D4").Value = (Range("B3") * (Range("A1") * 0.95) * 24) / 24
ElseIf (valueOfC3 = 36) Then
Range("D4").Value = (Range("B3") * (Range("A1") * 0.85) * 36) / 36
End If
End Sub
Display More
Hope it helps!
Stef
Works perfect now! Thanks a lot!
No idea, why the sheet is being renamed too... sorry
No one has an idea?
Thx in Advance!
stef
Please post the code you have so far...
Thx!
Stef
Hi everybody!
At Runtime I create an array holding lost of dynamically created textboxes, where the user hast to enter specific values.
Now I want to call a special procedure every time, the user enters a new value in one of the textboxes. (change event, I thought)
It is the same procedure for every textbox...
How do I do this?
Is it possible?
Thanks in Advance!
Stef
I do use them, but in addition i want to use the keyboard, as a special feature so to say!
Thx in Advance!
Stef