Using For Next???

Alpacino

Well-known Member
Joined
Mar 16, 2011
Messages
511
I have this:
If IsEmpty(Sheets(Sheet1).Range("F2") Then
Sheets(Sheet1).Range("A2").copy Sheets(Sheet2.Range("A2")
End If

I would like this if to work for each row in F2- F259
So example if cell F3 is empty copy A3 to sheet2 A3
If cell F4 is empty copy A4 to sheet2 A4

Can anyone help please??

Thanks
Alan
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try

Code:
Sub test()
Dim i As Long
For i = 2 To 259
    If Sheets("Sheet1").Range("F" & i).Value = "" Then Sheets("Sheet1").Range("A" & i).Copy Sheets("Sheet2").Range("A" & i)
Next i
End Sub
 
Upvote 0
Thanks for reply VoG
So will this sub produce a list of cell in sheet2 with names (if sheet1 column A is full of names???)
:)
 
Upvote 0
Yes, provided sheet1 column F is blank or contains a formula that evaluates to "".
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

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