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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,224,219
Messages
6,177,204
Members
452,764
Latest member
Mark1963

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