Results 1 to 5 of 5

Update Logic - Clear Contents & Cell Value Formatting

Threaded View

  1. #1
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Update Logic - Clear Contents & Cell Value Formatting

    Hello Friends..

    Can anyone please assist me in below Point 1 & pont 2..

    I tried everything but not getting a correct code to run..

    Point 1) Below is the code which helps to clear values from Cells of columns AA, AB & AC if Cells of Column Vis Null or empty


    Sub POINT1()
    
    
    Dim i As Long
    
    With ThisWorkbook.Worksheets("RESULTS")
    
     For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
            If .Range("V" & i).Value <> vbNullString Or .Range("V" & i).Value = "" Then
                 If InStr(1, .Range("V" & i).Value, "RUM", vbTextCompare) = 0 Then
                    .Range("AA" & i).ClearContents
                    .Range("AB" & i).ClearContents
                    .Range("AC" & i).ClearContents
                End If
            End If
        Next
    
    End With
    
    End Sub
    The problem here is that i am data of more than 50,000 & the above code takes around 30-45 minutes to execute or sometime crash or sometime no response


    Point 2) This below code copies the cell data from column 25 & paste it in column 26 if the cell is blank in column 26.. but after copying it is converting the date as date (
    attached is the file for reference..
    The data in Column Z cells marked in yellow shows data as year 2017.. but according to Column V its 2016 year.. example (RUM122316-070725-49)
    How can we change or update the code .. please suggest

    
    Sub POINT2()
    
    Dim NR As Long
    With ThisWorkbook.Worksheets("RESULTS")
    ActiveSheet.Range("Y:Y").Select
        With Selection
        .NumberFormat = "0"
        End With
    
        
        ActiveSheet.Range("Y2").Select
        NR = .Range("A" & .Rows.Count).End(xlUp).Row
        Range("Y2:Y" & NR).Formula = "=CONCATENATE(MID(V2,4,2),""/"",MID(V2,6,2))"
    
    
    Dim i As Long
    Dim LTR As Long
    
        With ThisWorkbook.Worksheets("RESULTS")
    LTR = .Range("A" & .Rows.Count).End(xlUp).Row
            For i = 2 To LTR
            If .Range("Z" & i).Value = vbNullString Or .Range("Z" & i).Value = "" Then
            Cells(i, 26).Value = Cells(i, 25).Value
            Cells(i, 26).Font.ColorIndex = 5
           
            End If
        Next
            Range("Z2:Z" & NR).Value = Range("Z2:Z" & NR).Value
        End With
        End With
    
    End Sub
    Last edited by Parth007; 01-04-2017 at 02:58 AM.
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Needing VBA code to clear contents of cell when the contents of another cell is cleared
    By jeh0714 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2016, 03:49 PM
  2. 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
  3. clear contents of cell based on column value/update continuously
    By forWork1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2015, 12:34 PM
  4. Clear Contents of a cell if contents = 1/0/00
    By superiorsvc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2015, 06:25 PM
  5. Validation value cell update logic
    By shelby_335 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-08-2015, 08:21 PM
  6. [SOLVED] Clear contents based on contents of another cell
    By Katrina DTE in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2013, 02:44 PM
  7. Clear Contents on Update when other code exists in the Worksheet_Change thingy
    By JRS_ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2011, 12:11 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