VBA shared file macro execution question

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,124
Office Version
  1. 365
Platform
  1. Windows
Hi All,

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!?

For example, When I test out this code prior to creating the
shared macro enabled document
it works like a charm without a problem.

Anyone, know how I can get around this without making the document un-shared??


Thank you!
Pinaceous
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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