Forum

Notifications
Clear all

Data Extract macro

22 Posts
2 Users
0 Reactions
145 Views
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Thanks so much  Sunny will test on the VB with live data.

 
Posted : 20/09/2018 3:50 am
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

How to make the following "Copy"  VB script more precise and comprehensive

Sub Copy()

Sheets("Test").Activate
    Range("A:F").ClearContents
    With Sheets("Master")
        .Range("H:H").Copy Range("A:A")
        .Range("I:I").Copy Range("B:B")
        .Range("M:M").Copy Range("C:C")
        .Range("L:L").Copy Range("D:D")
        .Range("AG:AG").Copy Range("E:E")
        .Range("AI:AI").Copy Range("F:F")
    Sheets("Test").Activate
    Sheets("Extract Field").Select
    Range("A2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("Test").Select
    Range("D1").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Select
     ActiveSheet.Paste
    Sheets("Extract Field").Select
    Range("B2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("Test").Select
    Range("C1").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Select
    ActiveSheet.Paste
    Sheets("Extract Field").Select
    Range("C2").Select
      Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("Test").Select
    Range("E1").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Select
    ActiveSheet.Paste
    End With
    End Sub

 
Posted : 21/09/2018 3:23 am
(@sunnykow)
Posts: 1417
Noble Member
 

Try this

 
Posted : 21/09/2018 9:16 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Tks millions again, Sunny  that superb,  reallly excellent painting,  my one better forget and shame to share.  

 
Posted : 21/09/2018 9:50 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi David

Glad to know it is what you wanted.

Sunny

 
Posted : 21/09/2018 10:32 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Tks Sunny  ...We learn a lot and honestly all of us here agreed we enhance our Excel skills so much via this Forum day after day ....

Your positive feedback and down to earth problems solving skills turn into our motivation to move on with achievments with our works or assignments ...

 
Posted : 22/09/2018 3:51 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi David

Thanks for your kind and flattering comments.Embarassed

Learning is a two-way process. While I give my two-cents worth of ideas (useful or otherwise) I am also learning a lot from MOTH and from users all around the world. This is something that cannot be achieved from only attending training or on-the-job training.

Hopefully more members will share their precious ideas with other in this forum.

Cheers

Sunny

 
Posted : 22/09/2018 10:39 am
Page 2 / 2
Share: