Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Cut&CopyMacro I need help with Macro code to do the following. I have a spreadsh

ID: 3569735 • Letter: C

Question

Cut&CopyMacro

I need help with Macro code to do the following.

I have a spreadsheet with many rows, as many as 20,000

The first row is my subject values

I would like to cut the values in every odd number row e.ge row 3, cells, C,D,E

and past them into the preceding even numbered row  e.g row 2 and paste the values into column F,G and H..

this cut and pasting would go on until the end of the sheet is reached..

I intend to use the Macro code to be attached to a control button to activate..

Is there any way for this Macro to run from Keystroke command??

thanks for any help!!

Explanation / Answer

Hi,

scenario is as follows:

data in active sheet

move data from rows 3,5,7,9,... and   columns C-D-E

and

goto rows 2-4-6-8,,, and columns F-G-H

next,

clear data from columns C-D-E

if so,

make a copy before you run this code...

Sub qazx()

Dim r As Long, x As Long
r = Cells(Rows.Count, "A").End(xlUp).Row
For x = 3 To r Step 2..
Cells(x, "C").Resize(, 3).Copy.
Cells(x - 1, "F").PasteSpecial xlValues.
Cells(x, "C").Resize(, 3).ClearContents.
Next
End Sub!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote