For each cell List items question

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
I want to try and produce a single list of items in a range where the cell in column A is not empty.

So far I have the following;

Code:
LastRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).RowFor Each Cell In Sheet2.Range("A12:A" & LastRow)
If Cell.Value <> "" Then
FaultyList = "Site: " & Cell.Value & vbNewLine & _
"Link: " & Cell.Offset(0, 1).Value & vbNewLine & vbNewLine
End If
Next

I want 'FaultyList' to be a list of all of those cells where column A is blank - I can get the first one fine, but how do I add the ones after the first found to the list?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try
Code:
FaultyList = "Site: " & Cell.Value & vbNewLine & _
"Link: " & Cell.Offset(0, 1).Value & vbNewLine & vbNewLine & FaultyList
 
Upvote 0
Fluff - thanks....

My Answer Is This - many thanks for posting, but Fluff beat you to it and his works.

Thanks to both!
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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