Loop macro to next column

Status
Not open for further replies.

ffionnah

Board Regular
Joined
Jun 12, 2018
Messages
61
Hi All,
I am trying to create a macro to paste a concatenation formula in Column E for the range of Columns G3 to BBI98. The current code I have is looping, but it is not continuously pasting this concatenation formula down through column E.

Is there a way for the concatenation formula to paste the info for the first group G3 to G98 in E3 to E98 and then loop back to H3 to H98 and paste this concatenation formula in E99 to E198... etc?

Thank you!


Code:
Sub ConcTrial()
Dim LastRowColumnE As Long
Dim RL As Long, Cl As Integer
RL = Cells(3, 7)






LastRowColumnE = Cells(Rows.Count, 7).End(xlUp).Row
For i = 7 To 1407


x = 3
If Cells(x, i) <> 1 Then
   Range("E3:E" & LastRowColumnE).FormulaR1C1 = "=IF(COUNTBLANK(RC[2])=1,"""",(CONCAT(R1C7,RC[2])))"
End If


 Next i




End Sub
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Status
Not open for further replies.

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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