Macro to Do until Value anywhere on Sheet.

ronanbaker1

Board Regular
Joined
Nov 15, 2012
Messages
76
Hi Guys,

Have a Macro that I want to stop the loop when the ANYWHERE on the sheet does not have the Cell.Value "Net Assets"

This is what I have got but it is not feeding correctly.

Could someone please tell me the adjustment I need?

Thanks

Do While ActiveSheet.Value <> "Net Assets" Is Nothing
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
To help with that I would need to see your code.

Do While ActiveSheet.Value <> "Net Assets" Is Nothing
Range("A1").Select
aa = ActiveCell.Address
Cells.Find(What:="Net Assets", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(7, 0).Select
bb = ActiveCell.Address
Range(aa, bb).Select
Selection.EntireRow.Cut
Sheets.Add After:=Sheets(Sheets.Count)
Cells.Select
ActiveSheet.Paste
Sheets("BSCOMP").Select

Selection.EntireRow.Delete
Loop
 
Upvote 0
A Sheet doesn't have a Value property so you can't do this:

Code:
Do While ActiveSheet.Value <> "Net Assets" Is Nothing

And I don't know why you need to loop. Assign the result of the Find method to a Range object. Then do nothing if that Range object is Nothing.
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,963
Members
449,200
Latest member
indiansth

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