how to make this less in proper code

wndncg

Board Regular
Joined
Mar 24, 2017
Messages
84
Office Version
  1. 2019
  2. 2016
  3. 2013
Sub INSERT_ME3()
Worksheets("1").Activate
Application.Wait (Now + TimeValue("0:00:01"))
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A6").Select
Range("A6").Value = Worksheets("1").Range("L5")
Application.Wait (Now + TimeValue("0:00:01"))
Range("B6").Select
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys ("^+{DOWN}")
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys ("^{DOWN}")
Application.SendKeys ("{LEFT}")
Application.SendKeys ("^{DOWN}")
Application.SendKeys ("+{SPACE}")
End Sub

---
see video how it works (doesnt work atm because i need help)
 
to copy sir, just fast the productivity

If you want to copy the range via code then you do not need to select it. You can directly copy it.

VBA Code:
.Range("A6:A" & lRow).Copy


If you still want to select the range then add one more line to the code

VBA Code:
 .Range("A6:A" & lRow).Select
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
If you still need a solution, then MODIFY the ADDED line as follows:
VBA Code:
    Range(Cells(LastA, "A"), Cells(LastB, "B")).EntireRow.Select              '<<< MODIFIED
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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