Results 1 to 5 of 5

Want to clear contents also from left column

Threaded View

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Post Want to clear contents also from left column

    hello
    i want to little change in below code
    in below code i want to delete also left column data

    Set RClear = cl.End(xlToRight)
    Set RClear = cl.End(xlToLeft)



    thanx a lot
    Option Explicit
     
    Sub ClearContents()
        Dim cl As Range, rCol As Range, RClear As Range
        Set rCol = Range("C2:C6", Range("C6").End(xlUp))
        Application.ScreenUpdating = False
        For Each cl In rCol
            If cl.Value = 0 Then
                Set RClear = cl.End(xlToRight)
                cl.ClearContents 'you can delete this to keep the formula
                RClear.ClearContents
                
            End If
        Next cl
        Application.ScreenUpdating = True
         
    End Sub
    Last edited by HaroonSid; 04-15-2014 at 07:34 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Changing static code to dynamic code
    By JamesFletcher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2013, 07:31 AM
  2. Need help changing code to use a different column
    By luke.guthrie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2012, 12:39 PM
  3. changing a code
    By alpertheidiot in forum Excel General
    Replies: 1
    Last Post: 06-15-2009, 05:46 AM
  4. [SOLVED] Changing this code
    By Neal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2006, 06:55 PM
  5. Help with changing code
    By Greg B in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2005, 12:06 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