SOLVED

Repeat Macro

Copper Contributor

Hi, 

I want to perform this action.

 

PozomDTermina Producción    
CimaBase    
 Sam-9969629781  Sam-9969621
Iride-72511371140   Sam-996978 

 

 So far i´ve been using this macro, but i want this action to be repeated in all the sheet (1500 lines).

Sub Macro6()
'
' Macro6 Macro
'

'
Range("B4").Select
Selection.Copy
Range("G4").Select
ActiveSheet.Paste
Range("C4").Select
Application.CutCopyMode = False
Selection.Copy
Range("G5").Select
ActiveSheet.Paste
Range("D4").Select
Application.CutCopyMode = False
Selection.Copy
Range("H4").Select
ActiveSheet.Paste
Range("A4").Select
Application.CutCopyMode = False
Selection.Copy
Range("F4").Select
ActiveSheet.Paste
Range("F4").Select
Application.CutCopyMode = False
Selection.Copy
Range("F5").Select
ActiveSheet.Paste
End Sub

 

 

Any help would be awesome.

 

 

6 Replies

Hi Angel,

 

Please explain more about what you are trying to do.

 

Hi Haytham Amairah

 

What im trying to do, is transpone column B and C, Paste column A twice and paste column C  aside the value in column B.  I need repeat that action in 1500 lines. 

 

PozomDTermina Producción    
CimaBase    
 Sam-9969629781  Sam-9969621
Iride-72511371140   Sam-996978 

 

Excuse me if im not being clear :(

best response confirmed by Angel Villela (Copper Contributor)
Solution

Hi,

 

This can be done by using Power Query which is also known as (Get & Transform Data in Excel 2016), and if you don't have Excel 2016, then you have to download and install Power Query Add-in.

 

The Power Query is much easier than Macros and VBA.

 

Please find the attached file and try to update the left table, then right-click on the right table and select Refresh to see how it will be updated.

 

Regards

Thank you so much,

 

I´m going to try it.

 

Best wishes.

Hi Haytham Amairah,

 

On monday i received your help, but i have an incovinient in the example provided one column is missing and i´ve been trying to change the arrangement without success.

In the image, there is a better explanation.

 

In advance, thanks for yur help.

Hi Angel,

 

I've updated the attached workbook with the possible solution.

 

Hope that helps

1 best response

Accepted Solutions
best response confirmed by Angel Villela (Copper Contributor)
Solution

Hi,

 

This can be done by using Power Query which is also known as (Get & Transform Data in Excel 2016), and if you don't have Excel 2016, then you have to download and install Power Query Add-in.

 

The Power Query is much easier than Macros and VBA.

 

Please find the attached file and try to update the left table, then right-click on the right table and select Refresh to see how it will be updated.

 

Regards

View solution in original post