VBA Help

JoeyGaspard

Board Regular
Joined
Jul 22, 2019
Messages
147
Hi all, I have a spreadsheet where I am trying to use VBA to delete all rows if the cell in column B is blank, for some reason it is not working? The code I am using is listed below, any help is greatly appreciated!


'Delete Blank Rows if No Data in cells in Column B
On Error Resume Next
Sheets("GeneralJournal").Select
With Range("B17:B500")
.Value = .Value
.SpecialCells(xlBlanks).EntireRow.Delete
End With
Range("B17").Select

Thanks!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Sorry:) It returns nothing, the cell i put the formula in returns blank
That is not possible. Then LEN function cannot return nothing. It should return a number, like 0.
Do you have some sort of Custom Format being applied to the cell you are placing it in that hides/suppresses the number 0?
What is the format on that cell?
 
Upvote 0
If you put it on a share site such as onedrive, google, dropbox, mark for sharing & post the link to the thread I will take a look at it.
 
Upvote 0
That is not possible. Then LEN function cannot return nothing. It should return a number, like 0.
Do you have some sort of Custom Format being applied to the cell you are placing it in that hides/suppresses the number 0?
What is the format on that cell?
1604593066587.png
 
Upvote 0
That is asking me to sign in, you need to mark the file for sharing & then post the link that it gives you.
 
Upvote 0
That is not possible. Then LEN function cannot return nothing. It should return a number, like 0.
Do you have some sort of Custom Format being applied to the cell you are placing it in that hides/suppresses the number 0?
What is the format on that cell?
It was returning a zero, it just wasnt showing in the cell
 
Upvote 0
It was returning a zero, it just wasnt showing in the cell
OK. Thanks for confirming.

Unfortunately, I am unable to download files from my current location (our work computers are "locked down"), but it sounds like Fluff is able to.
Hopefully, he will be able to determine what is going on.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

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