Help with looping a copy/paste function in VBA

arooney88

Board Regular
Joined
Feb 17, 2014
Messages
61
Hi everyone, have a situation that I'm wondering how to loop the action to save me some time.

I have 340 assignments, every 3 cells is grouped into a new assignment. Assignment1= Columns B,C,D Assignment2=E,F,G
Assignment3=H,I,J

My issue is that I need to copy/paste the formulas for B5,5C all the way across for 340 assignments but B5 doesn't keep adding the row # because I'm pasting horizontal across and it's a locked reference. My formula in C5 is a date formula that pops the current day whenever an analyst answers a Yes, No, or N/A in B6, E6, H6, etc. C5 works but I'd have to do it by hand for 340 assignments.

What I'm doing now is I built out 20 assignments that are correct order and formulas, I copy/paste them across and then use a macro that finds/replaces to the correct locked cell reference from the Annie sheet, but this takes a lot of manual labor and can lead to mistakes.

I'm a beginner in using VBA for loops but I'm wondering if this is a situation I could start to develop one? Any help on this would be great! Thanks!


B
C
D
E
F
G
H
I
J
4
PROC ID
DATE
ANALYST
PROC ID
DATE
ANALYST
PROC ID
DATE
ANALYST
5
=Annie'!$D$3
=IF(B6<>"", IF(B5<>0, NOW(), ""), "")
Annie C.
=Annie'!$D$4
=IF(E6<>"", IF(E5<>0, NOW(), ""), "")
Annie C.
=Annie'!$D$5
=IF(H6<>"", IF(H5<>0, NOW(), ""), "")
Annie C
6
Yes
No
N/A

<TBODY>
</TBODY>
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Sorry for the bad table that got posted.

The formulas are:

B5=Annie'!$D$3
C5=IF(B6<>"", IF(B5<>0, NOW(), ""), "")
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

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