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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Status
Not open for further replies.

Forum statistics

Threads
1,214,553
Messages
6,120,182
Members
448,948
Latest member
spamiki

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