Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Hi All,
I've created a shared macro enabled document.
When I try to execute a removing blanks code:
Provided as reference:
It produces
For example, When I test out this code prior to creating the
Anyone, know how I can get around this without making the document un-shared??
Thank you!
Pinaceous
I've created a shared macro enabled document.
When I try to execute a removing blanks code:
Provided as reference:
Code:
Sub Macro19()
'
' Macro19 Macro
' Removing Blanks
'
Sheets("Sheet4").Select
Dim r As Range, rw As Range, Rws As Long
Set r = Range("B10:Q179") 'Change range to suit
Application.ScreenUpdating = False
For Each rw In r.Rows
If Application.CountA(rw) = 0 Then
rw.Value = "#N/A"
Rws = Rws + 1
End If
Next rw
With r
On Error Resume Next
.SpecialCells(xlCellTypeConstants, xlErrors).Delete Shift:=xlUp
.Cells(.Rows.Count + 1, 1).Resize(Rws, r.Columns.Count).Insert Shift:=xlDown
On Error GoTo 0
End With
Application.ScreenUpdating = True
End Sub
It produces
in the inserted row that I'd expect it to be blank!?#N/A
For example, When I test out this code prior to creating the
it works like a charm without a problem.shared macro enabled document
Anyone, know how I can get around this without making the document un-shared??
Thank you!
Pinaceous