Forum Discussion
Repeat Macro
Hi,
I want to perform this action.
| Pozo | mD | Termina Producción | |||||
| Cima | Base | ||||||
| Sam-996 | 962 | 978 | 1 | Sam-996 | 962 | 1 | |
| Iride-725 | 1137 | 1140 | Sam-996 | 978 |
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.
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 https://www.microsoft.com/en-us/download/details.aspx?id=39379.
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
6 Replies
- Haytham AmairahSilver Contributor
Hi Angel,
Please explain more about what you are trying to do.
- Angel VillelaCopper Contributor
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.
Pozo mD Termina Producción Cima Base Sam-996 962 978 1 Sam-996 962 1 Iride-725 1137 1140 Sam-996 978 Excuse me if im not being clear :(
- Haytham AmairahSilver Contributor
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 https://www.microsoft.com/en-us/download/details.aspx?id=39379.
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