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
 

Forum statistics

Threads
1,081,845
Messages
5,361,663
Members
400,643
Latest member
RockStar89

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top