roy.aritra
New Member
- Joined
- Jul 20, 2011
- Messages
- 2
Hello,
I am very new to VBA programming.
I have a VBA project that navigates to a website and then fills up a form. I need to enter the start date and the end date.
When I click on the start_date box it open a pop-up calendar and once I select a date the end date takes the next 30 days (by default).
I have written a code to fill the start date and end date but that does not allow me to complete the form.
Here is some of my code:
I am very new to VBA programming.
I have a VBA project that navigates to a website and then fills up a form. I need to enter the start date and the end date.
When I click on the start_date box it open a pop-up calendar and once I select a date the end date takes the next 30 days (by default).
I have written a code to fill the start date and end date but that does not allow me to complete the form.
Here is some of my code:
Code:
For Each Item In IE.document.all
ItemInnerText = ""
ItemName = ""
ItemValue = ""
ItemType = ""
itemid = ""
itemclass = ""
On Error Resume Next
ItemInnerText = Item.innerText
ItemName = Item.Name
ItemValue = Item.Value
ItemType = Item.Type
itemid = Item.ID
itemclass = Item.class
'Filling up the name of the campaign
If itemid = "name" And ItemName = "name" Then
Item.Value = Sheets("GR_SIP").Range("B2").Value
End If
'Filling up the shortname of the campaign
If itemid = "short_name" And ItemName = "short_name" Then
Item.Value = Left(Sheets("GR_SIP").Range("B2").Value, 8)
End If
'Entering the start_date of the campaign
If itemid = "start_date" And ItemName = "start_date" Then
Item.Value = "2011-06-01"
End If
'Entering the end_date of the campaign
If itemid = "end_date" And ItemName = "end_date" Then
Item.Value = Sheets("GR_SIP").Range("A2").Value
End If
'Entering the Media numbers
If itemid = "media_lookup" Then
Item.Click
End If