Results 1 to 6 of 6

Macro to clear zeroes

Threaded View

Howardc1001 Macro to clear zeroes 12-19-2019, 10:05 AM
JLGWhiz Re: Macro to clear zeroes 12-19-2019, 04:48 PM
Howardc1001 Re: Macro to clear zeroes 12-19-2019, 08:51 PM
Howardc1001 Re: Macro to clear zeroes 12-19-2019, 09:13 PM
Howardc1001 Re: Macro to clear zeroes 12-19-2019, 08:28 PM
JLGWhiz Re: Macro to clear zeroes 12-21-2019, 09:57 AM
  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,876

    Macro to clear zeroes

    I have a workbook that is linked to another workbook

    I have tried to write code to clear all zeroes on the activesheet, but cannot get it to work. Where the data is linked to another workbook and shows a zero is must be cleared , except where there is a zero is shown as a currency i.e. it has an R in front of the zero


     Sub Clear_Zeroes_Blanks()
     Dim lr As Long, i As Long
     lr = Cells(Rows.Count, "A").End(xlUp).Row
     Application.ScreenUpdating = False
     Application.EnableEvents = False
     
        For i = lr To 1 Step -1
            With activeSheets
                If (.Cells(i, "A").Resize(, 20).Value) = 0 Then
                    .Cells(i, "A").Resize(, 20).ClearContents
                End If
            End With
            With activeSheets
            If (.Cells(i, "A").Resize(, 20).Value) = vbNullString Then
                    .Cells(i, "A").Resize(, 20).ClearContents
                End If
            End With
            
        Next i
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    End Sub

    I have attached the source workbook "Data analysis Dept 1.xlsx' as well as the destination workbook containing the macro "Data Analysis All Departments.xlsm"


    Your assistance in resolving this is most appreciated
    Attached Files Attached Files
    Last edited by Howardc1001; 12-19-2019 at 01:25 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to eliminate zeroes if numbers in column match and both sets of columns have zeroes
    By luajambeiro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2019, 05:07 PM
  2. Clear Column by macro
    By Tefa Tato in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2016, 07:26 AM
  3. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  4. [SOLVED] Macro to create csv file delete leading zeroes
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-20-2015, 04:40 AM
  5. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  6. Add zeroes within dates (NOT leading zeroes)
    By anthony19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 04:08 PM
  7. Replies: 1
    Last Post: 02-24-2009, 04:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1