If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Replace "x" with green and empty with "x"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-04, 16:37
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Lightbulb 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
Reply With Quote
  #2 (permalink)  
Old 03-25-04, 09:26
shades shades is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 03-25-04, 10:00
sjumma sjumma is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On