How to copy then paste with pause multiple times in excel VBA

Masta

New Member
Joined
Feb 22, 2022
Messages
33
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
I have a problem that I want to solve and I have succeeded to some extent. I coded a couple of lines, but I didn't succeed in the idea of realizing it to the end. I want to copy the data from the Address field to another application I'm working on when I click in the provided TextBox1 in that application after 2 seconds and then in the next TextBox2 after 2 seconds and so on. I hope you come up with an idea. This solution of mine only works for one field of TextBox copy/paste in another application. I have a total of 4 TextBox. Thank you.
sample 1.jpg

Private Sub CommandButton126_Click()
'TextBox10.SetFocus
'Application.SendKeys "^A"
'Application.SendKeys "^C"
With New MSForms.DataObject 'For copy just another way
.SetText TextBox10.Text
.PutInClipboard
End With
Dim Shex As Object
Set Shex = CreateObject("Shell.Application")
tgtfile = "C:\Users\Masta\Desktop\test\something.url"
Shex.Open (tgtfile)
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "^V"
ActiveWindow.WindowState = xlMinimized
End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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