helping scaling down small code...

buzz71023

Active Member
Joined
May 29, 2011
Messages
290
Office Version
  1. 2016
Platform
  1. Windows
If anyone has any recommendations that might make this a little smaller, I would appreciate it. Its not that slow or long but every little bit will helps.

Application.ScreenUpdating = False
Sheets("Test Sheet").Select
Range("Ash3Freq").Value = ComboBox1.Value
Range("Ash3Trgt").Value = TextBox1.Value
Range("Ash3Hi").Value = TextBox2.Value
Range("Ash3Low").Value = TextBox3.Value
Sheets("Test Sheet").Select
Columns("D:D").Select
Selection.Copy
Sheets("Data Sheet").Select
Columns("I:I").Select
Selection.Insert Shift:=xlToRight
Range("I7").Select
Sheets("Test Sheet").Select
Range("D8:D11").ClearContents
Sheets("Data Sheet").Select
Range("C2, C2").Select
Application.ScreenUpdating = True

Unload Me
 

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
Code:
    Application.ScreenUpdating = False
    
    With Sheets("Test Sheet")
        .Range("Ash3Freq").Value = ComboBox1.Value
        .Range("Ash3Trgt").Value = TextBox1.Value
        .Range("Ash3Hi").Value = TextBox2.Value
        .Range("Ash3Low").Value = TextBox3.Value
    End With
    
    Sheets("Test Sheet").Columns("D:D").Copy
    Sheets("Data Sheet").Columns("I:I").Insert Shift:=xlToRight
    Sheets("Test Sheet").Range("D8:D11").ClearContents
    
    Application.Goto Reference:=Worksheets("Data Sheet").Range("C2")
    
    Application.ScreenUpdating = True
    
    Unload Me
 
Last edited:
Upvote 0

Forum statistics

Threads
1,203,462
Messages
6,055,563
Members
444,799
Latest member
CraigCrowhurst

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