Repeat Code in VBA between two sheets and moving down one raw after each cycle on the one sheet

TeaJ

New Member
Joined
Feb 15, 2022
Messages
2
Platform
  1. Windows
I do not know to write a macro, I recorded a macro to create the following code, but I have difficulty to make it loop and moving down one raw after each cycle.
As the code below it repeats itself. It will be so helpful to have way to repeat the code for a specified number of rows in Tumor without physically repeating the code. I have about 421 iterations.

I am hoping to have guidance and help. I am hoping to learn. Thank you
Tea

Sub Macro3()
'
' Macro3 Macro
'

'
Sheets ("Tumor").Select
Range("A2:C2").Select
Selection.Copy
Sheets("Calculation").Select
Range("G2").Select
ActiveSheet.Paste
Range("P2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tumor").Select
Range("F2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets ("Tumor").Select
Range("A3:C3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Calculation").Select
Range("G2").Select
ActiveSheet.Paste
Range("P2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tumor").Select
Range("F3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets ("Tumor").Select
Range("A4:C4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Calculation").Select
Range("G2").Select
ActiveSheet.Paste
Range("P2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tumor").Select
Range("F4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Tumor").Select
Range("A5:C5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Calculation").Select
Range("G2").Select
ActiveSheet.Paste
Range("P2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tumor").Select
Range("F5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets ("Tumor").Select
Range("A6:C6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Calculation").Select
Range("G2").Select
ActiveSheet.Paste
Range("P2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tumor").Select
Range("F6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub


I much appreciate any help.
Thank you again
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I want to describe process with words that can be more informative

Here what I am trying to do.
I have two sheets one "Calculation" and second "Tumor".
I need other copy and paste from Tumor A2:C2 to "Calculation" G2:I2, or make "Calculation" G2 = "Tumor" A2, "Calculation" H2 = "Tumor" B2 and "Calculation" I2 = "Tumor" C2.
After this operation is done. I need to copy From "Calculation" O2 and paste special values to "Tumor" F2
IN the next step I need to move one step only in "Tumor" sheet and paste or equal to same cell in "Calculation" sheet as well as copy from same cell in "Calculation" sheet and paste special values to "Tumor" sheet in F column one raw below from previous action.
for example, other copy or paste from Tumor A3:C3 to "Calculation" G2:I2, or make "Calculation" G2 = "Tumor" A3, "Calculation" H2 = "Tumor" B3 and "Calculation" I2 = "Tumor" C3.
After this operation is done. I need to copy From "Calculation" O2 and paste special values to "Tumor" F3
only underlined cells above need to change in next cycle. I am hoping I explained process well. Please let me know if you have question. I much appreciate your help
Best wishes
Tea
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,184
Members
448,554
Latest member
Gleisner2

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