fix my code
See file attachment for important images and current code, correct each line of code and add the additional need code to work
## Deliverables
**********************
*
* EXCEL VBA script
*
**********************
Sub S()
For i = 1 To 10
'(slide page 1)*************************
' go to [login to view URL]
' look up value in column B row i
' enter value in date field form [login to view URL]
( this code is not accurate)
DateValue = Workbook(Book2).Cells(i, 1)
ComboValue = Workbook(Book2).Cells(i, 7)
'(slide page 2)************************
'Set WshShell = CreateObject("[login to view URL]")
'go to internet explorer
[login to view URL] "Query Parameters - Microsoft Internet Explorer"
Sleep 100
'Start at "starting point for each loop"
enter code
'tab (8x) to get to first date field
For x = 1 To 8
[login to view URL] "{tab}"
Sleep 500
Next x
'paste value stored in dateValue in the internet explorer field
enter code
'tab (2x) to get to second date field
For x = 1 To 2
[login to view URL] "{tab}"
Sleep 500
Next x
'paste value stored in dateValue in the internet explorer field
enter code
(DateValue)
'tab (2x) to get to ComboValue field
For x = 1 To 2
[login to view URL] "{tab}"
Sleep 500
Next x
'paste value stored in dateValue in the internet explorer field
enter code
(ComboValue)
'tab (2x) to get to 'OK' link
For x = 1 To 12
[login to view URL] "{tab}"
Sleep 500
Next x
'select the OK button( this code is not accurate)
keybd_event VK_Enter, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_Enter, 0, KEYEVENTF_KEYUP, 0
'slide 3*************************************
'wait 3 minutes for data to process
Sleep (300000)
'Set WshShell = CreateObject("[login to view URL]")
'go to internet explorer new page
[login to view URL] "BIAS WEBDashboard - Microsoft Internet Explorer"
Sleep 1000
'tab (2x) to get to export search field field
For x = 1 To 12
[login to view URL] "{tab}"
Sleep 500
Next x
'select the 'Export search results o excel' link
( this code is not accurate)
keybd_event VK_Enter, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_Enter, 0, KEYEVENTF_KEYUP, 0
'*slide 4***************************************
'sleep(4 seconds) to allow downloading
Sleep (4000)
'select SAvE and name file as the value stored in ComboValue => [login to view URL](i,7)// column G
enter code
'*********side 5 **********************************
'open the file just saved and named 'combovalue'
'look through column AN and find the rows that has value 204
'allow user to change value to search for
ValueSearch = 204
'if value in cells(row=i, columnAN) =ValueSearch
'************slide 6 *****************************
For n = 0 To 5 ' looking through all the vallues that have ValueSearch=204 in column AN
copy the data in that row for columns( X, Y , Z, AA , AN ) to Book2 in column(AB,AC, AD, AE, AF)
'notice that the next set of data will be added to the right of the column AF using the ((column AB)+n)
workbook(Book2).cells(i,(column AB)+n)= cells(row,columnX)
workbook(Book2).cells(i,(column AC)+n)= cells(row,columnY)
workbook(Book2).cells(i,(column AD)+n)= cells(row,columnZ)
workbook(Book2).cells(i,(column AE)+n)= cells(row,columnAA)
workbook(Book2).cells(i,(column AF)+n)= cells(row,columnAN)
Next n
Next i
End Sub