Excel need to copy, alt tab to IE then paste and alt tab back, then move down and copy again.

snprshot

New Member
Joined
May 30, 2016
Messages
4
Hello im trying to populate an IE page with an excel macro, by copying a cell value, alt tabbing to the IE page, pasting the value in the IE, then alt tabbing back to the excel, and moving down one and repeating this function over again. so far i have this code that doesnt work on the IE page.
Code:
Sub alttabtest()
    Dim x As Long, AltKey As String, TabKey As String
    AltKey = "%"
    TabKey = "{TAB}"


    For x = 1 To 16
    '   copy active cell's value
        With ActiveCell
        .Copy
        GoSub ThisTime
            SendKeys AltKey & TabKey
        GoSub ThisTime
            SendKeys "^v", True
        GoSub ThisTime
            SendKeys AltKey & TabKey
            .Offset(0, 1).Select
        End With
    Next x
        Exit Sub
ThisTime:
    Application.Wait (Now + TimeValue("00:00:01"))
    Reset
End Sub
Which was given to me by rhodie72. within this code the RESET function is whats causing issue and i dont know why.

and my own code that just does the functions of copying, alt tabbing, pasting, alt tabbing, moving down and looping.
Code:
Sub macrotest()
Dim x As Long


' macrotest Macro
' macrotest
'
' Keyboard Shortcut: Ctrl+q
    For x = 1 To 16
        Selection.Copy
        Application.Wait (Now + TimeValue("00:00:01"))
        SendKeys "%{TAB}", True
        Application.Wait (Now + TimeValue("00:00:01"))
        SendKeys "^v", True
        Application.Wait (Now + TimeValue("00:00:01"))
        SendKeys "%{TAB}", True
        ActiveCell.Offset(0, 1).Range("A1").Select
    Next x


    '
End Sub
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,025
Messages
6,122,734
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top