VBA to ADD TAB to COPIED TEXT for PASTING ACROSS FIELDS in ONLINE FORM

Turk182

Board Regular
Joined
Sep 9, 2009
Messages
66
Office Version
  1. 365
Platform
  1. MacOS
VBA to ADD TAB to COPIED TEXT for PASTING ACROSS FIELDS in ONLINE FORM

Good afternoon,

I need a VBA code that will copy the following from Cells Q1 to Q4 into the clipboard in such a way that when pasted to an online form, the information is parsed out into each of four successive fields of that form: Name, Address, Phone, and Email

Thank You.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
This copies those cells and pastes them into four consecutive fields.
The first field must be active before starting the code.
The operation is based on sendkey, so the code enters the data blindly, in four places, even in the wrong program or tab.
Most special characters do not work here.
The code is very unstable for the reasons mentioned above.

I'm not sure you meant/want this?

VBA Code:
Sub TS_fill_form()
    
Dim cell As Range, DataRNG As Range
Dim i As Integer
Set DataRNG = ThisWorkbook.ActiveSheet.Range("Q1:Q4")
Application.SendKeys ("%{TAB}")
Application.Wait (Now + TimeValue("0:00:02") / 2)

i = 1
For Each cell In DataRNG
    Application.Wait (Now + TimeValue("0:00:02") / 5)
    Application.SendKeys cell.Value
    Application.Wait (Now + TimeValue("0:00:02") / 5)
    If i <= 3 Then Application.SendKeys ("{TAB}")
    i = i + 1
Next

End Sub
 
Upvote 0
Solution
Thank you for the feedback!
It's nice to hear that we were able to help.
 
Upvote 0

Forum statistics

Threads
1,215,052
Messages
6,122,878
Members
449,097
Latest member
dbomb1414

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