VBA Loop?

Status
Not open for further replies.

mrsushi

Board Regular
Joined
Nov 18, 2006
Messages
180
Office Version
  1. 2010
Good evening,

I have Column A with over 30,000 cells of data.

Column D+E+F+G have formulas run via a VBA script (This is as per below). The problem with applying the below via a script, is it takes forever to complete.

Is there an alternative VBA code to which can speed up the below? A loop ie for i?

Many thanks


lngLastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("D5:D" & lngLastRow).FormulaR1C1 = "=IF(COUNTIF(R5C1:R50000C1,RC1)>1,""Duplicate"","""")"

lngLastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("E5:E" & lngLastRow).FormulaR1C1 = "=VLOOKUP(CONCATENATE(RC[-4],"" "", RC[-3]),'LT03 Full Data'!C[-4]:C[-2], 2, FALSE)"

lngLastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("F5:F" & lngLastRow).FormulaR1C1 = "=VLOOKUP(CONCATENATE(RC[-5],RC[-4]),'LT03 Full Data'!C[-5]:C[-3], 2, FALSE)"

lngLastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("G5:G" & lngLastRow).FormulaR1C1 = "=IF(ISTEXT(RC[-2]),RC[-2],IF(ISTEXT(RC[-1]),RC[-1]))"
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Reported as duplicate of
 
Upvote 0
Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

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