dont know how to di this

alan myers

Board Regular
Joined
Oct 31, 2017
Messages
119
Office Version
  1. 365
Platform
  1. Windows
Sub step1()
'
' step1 Macro
'
For x = 0 To 50

'
Range("A111").Select
Selection.Cut
Range("C110").Select
ActiveSheet.Paste
Range("A112").Select
Selection.Cut
Range("D110").Select
ActiveSheet.Paste
Range("A110:D110").Select
Selection.Cut
ActiveWindow.SmallScroll Down:=-54
Range("A55+x").Select
ActiveSheet.Paste
Range("C61").Select
ActiveWindow.SmallScroll Down:=57
Rows("110:111").Select
Selection.Delete Shift:=xlUp
Range("C119").Select

Next x


this part
Range("A55+x").Select









End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Also this is how to tidy your code up after recorded.

Though it seems a bit nonsensical at a glance to keep cutting and pasting then delete what you pasted


VBA Code:
Sub step1()
'
' step1 Macro



For x = 0 To 50
Range("A111").Cut Range("C110")
Range("A112").Cut Range("D110")
Range("A110:D110").Cut Range("A" & 55 + x)
Rows("110:111").Delete Shift:=xlUp

Next x

Range("C119").Select
 
Upvote 0
Solution
Also this is how to tidy your code up after recorded.

Though it seems a bit nonsensical at a glance to keep cutting and pasting then delete what you pasted


VBA Code:
Sub step1()
'
' step1 Macro



For x = 0 To 50
Range("A111").Cut Range("C110")
Range("A112").Cut Range("D110")
Range("A110:D110").Cut Range("A" & 55 + x)
Rows("110:111").Delete Shift:=xlUp

Next x

Range("C119").Select
 
Upvote 0
Might have been easier to simply explain what you are trying too do rather than post a vague macro.
I'm sure someone will write a more efficient snippet of code.
You also need to update your profile, telling us your Excel version AND what OS you are using. Answers can be different for different version of Excel AND OS
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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