Code Simplification Help

Page 1 of 1

1 Replies - 211 Views - Last Post: 18 January 2019 - 10:17 AM Rate Topic: -----

#1 kyle01   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 208
  • Joined: 26-November 14

Code Simplification Help

Posted 18 January 2019 - 07:33 AM

I have this code that I need to simplify and make more elegant, also the code stops when it encounters a blank cell, what is the workaround for this?

Sub Button1_Click()
'Field Name
Windows("childsheet.xlsm").Activate
Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("parentsheet.xlsm").Activate
Range("A3").Select
ActiveSheet.Paste

'API Name
Windows("childsheet.xlsm").Activate
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("parentsheet.xlsm").Activate
Range("B3").Select
ActiveSheet.Paste

'Type
Windows("childsheet.xlsm").Activate
Range("C3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("parentsheet.xlsm").Activate
Range("C3").Select
ActiveSheet.Paste

'Length
Windows("childsheet.xlsm").Activate
Range("D3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("parentsheet.xlsm").Activate
Range("D3").Select
ActiveSheet.Paste

'Required
Windows("childsheet.xlsm").Activate
Range("E3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("parentsheet.xlsm").Activate
Range("E3").Select
ActiveSheet.Paste

'Read Only?
Windows("childsheet.xlsm").Activate
Range("F3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("parentsheet.xlsm").Activate
Range("F3").Select
ActiveSheet.Paste
End Sub



Is This A Good Question/Topic? 0
  • +

Replies To: Code Simplification Help

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14852
  • View blog
  • Posts: 59,263
  • Joined: 12-June 08

Re: Code Simplification Help

Posted 18 January 2019 - 10:17 AM

Please do not create duplicate topics. Closing.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1