Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    232

    Lightbulb Unanswered: Replace "x" with green and empty with "x"

    I have an excel sheet with "x" which i want to replace it with

    colour say green or check box and leave the rest as it is

    i want to delete the empty rows automatically


    how best to do that
    bigfoots

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    As far as deleting the empty rows, you can use this approach with VBA:

    Code:
    Sub DeleteEmptyRows()
    'This is one I developed to allow user to enter letter
    'of the column that is used for deleting.
    Application.ScreenUpdating = False
        Dim myColm As String
        Dim n As String
        Dim Rng As Range
        Dim lngRow As Long
        myColm = InputBox("Enter Letter")
        
        If myColm <> "" Then
            n = myColm
            Set Rng = Range(n & "1", Range(n & "65536").End(xlUp))
            For lngRow = Rng.Rows.Count To 2 Step -1
                If Rng(lngRow) = "" Then
                    Rng(lngRow).EntireRow.Delete
                End If
            Next lngRow
        Else
            Exit Sub
        End If
    Application.ScreenUpdating = True
    
    End Sub
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Oct 2003
    Posts
    232

    code import

    Thanks

    how do i create this code inthe excel i dont know where to put

    i started the editor

    copied the code and it showed me error

    pls guide how to put this code on excel
    bigfoots

Posting Permissions

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