+ Reply to Thread
Results 1 to 2 of 2

VBA to clear numbers and replace with previous cell value.

Hybrid View

acsishere VBA to clear numbers and... 10-23-2017, 09:42 AM
than_gold Re: VBA to clear numbers and... 10-23-2017, 10:34 AM
  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    VBA to clear numbers and replace with previous cell value.

    Dear Friends,
    I request a VBA to clear numbers and replace with previous cell value in column A. As the no. of rows may vary, it is require find the lastrow and do till the end.

    I hereby attached a sample file in which my requirements are mentioned. Request your kind help, pl.
    Attached Files Attached Files
    Good friends are hard to find, harder to leave, and impossible to forget.

    acsishere.

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: VBA to clear numbers and replace with previous cell value.

    Hello, Please check this out, still need some more change needed in below code.

    Option Explicit
    
    Sub remove_numeric()
    'to clear numerical values in cells
    On Error Resume Next
        Columns("A").SpecialCells(xlCellTypeConstants, xlNumbers).ClearContents
    On Error GoTo 0
    End Sub
    Sub FillCellsFromAbove()
        ' Turn off screen updating to improve performance
        Application.ScreenUpdating = False
        On Error Resume Next
        ' Look in column A
        With Columns(1)
            ' For blank cells, set them to equal the cell above
            .SpecialCells(xlCellTypeBlanks).Formula = "=R[-1]C"
            'Convert the formula to a value
            .Value = .Value
        End With
        Err.Clear
        Application.ScreenUpdating = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 10
    Last Post: 07-28-2015, 08:22 AM
  2. Replies: 7
    Last Post: 12-15-2014, 02:20 PM
  3. Problem with Page set up not clear previous Header
    By wayneao in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2014, 01:25 PM
  4. [SOLVED] Noob using marco, I need to clear what my previous macro copied before pasting my new one
    By Slinky84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2014, 01:35 PM
  5. [SOLVED] Clear contents of last used cell in a range and those previous to it (excel 2003)
    By chris_norton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2012, 02:06 PM
  6. Clear previous sheets before copying rows
    By Fferjay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2011, 09:37 PM
  7. ClearContents and Clear not removing previous copied terms (from userforms)
    By eurydice88 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-02-2010, 11:41 AM

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