For loop doesn't complete on the first run

Varidian

New Member
Joined
Jan 27, 2021
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hi all I have a bit of code that is basically looks to the cell 2 its right, finds the @ and returns the domain name. however, sometimes when I first run the full macro, it only completes about 30 rows even though there are 900 + rows in it.

at first, I thought it was a time issue so I put a wait in for 5 seconds. It's really bugging me

VBA Code:
  For x = 2 To Lr
        SplitPos = InStr(1, Cells(x, 1), "@", vbTextCompare)
        Ws_Clean.Cells(x, 2).value = Mid(Cells(x, 1), SplitPos + 1)
  Next x
 
Which has already been mentioned twice. Do you ever actually bother to read anything?
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,422
Messages
6,119,396
Members
448,891
Latest member
tpierce

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