+ Reply to Thread
Results 1 to 3 of 3

Trasparent color excel vba 2007 not working

Hybrid View

  1. #1
    Registered User
    Join Date
    07-16-2013
    Location
    Milan
    MS-Off Ver
    Excel 2007
    Posts
    12

    Trasparent color excel vba 2007 not working

    Hello
    I have this problem with this macro.
    The first 5 rows contains description, the user insert data starting from row number 6
    Rows 1 , 3 and 5 , they contain user information , are colored in yellow.
    Why during insert data row 6 is trasparent color , row 7 is colored in yellow, row 8 trasparent color, row 9 in yellow and so on ( one row trasparent, one row yellow). I want to have for all data inserted into the rows trasparent color. in attachemnt the excel file with macro to renaim in .xlms. My excel version is 2007.
    Thanks

    Here is is the code

    Sub Pulizia_righe()
    Dim max_rows, rows_true, No_Of_Files, r, r1, Num_righe_testata As Integer
    
    
    Dim pos_punto As Byte
    
    max_rows = ActiveSheet.UsedRange.Rows.Count
    
    'File_Path = Worksheets("Foglio1").Cells(2, 1)
    r = 6
    
    
    
    Do While r <= max_rows
        If Sheets("Foglio1").Cells(r, 1).Value = Empty Then
            Exit Do
        End If
    
        Sheets("Foglio1").Cells(r, 1).Value = Empty
        r = r + 1
    Loop
    Range("A6").Select
    MsgBox "clean completed.", vbInformation
    End Sub
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Trasparent color excel vba 2007 not working

    Hello valgo54,

    This change to your macro will clear the cells in column "A". However, it will not change the cell color. Rows 1 through 5 will remain the same.
    Sub Pulizia_righe()
    
      ' Questa pulisce i campi correttamente senza l'effetto una riga grigia e una no ( 26/07/2013)
        Dim max_rows, rows_true, No_Of_Files, r, r1, Num_righe_testata As Integer
        Dim File_Path, fin_nome_file, iniz_nome_file, GivenLOcation As String
        Dim pos_punto As Byte
        
        Dim Rng As Range
        Dim RngEnd As Range
    
          ' File_Path = Worksheets("Foglio1").Cells(2, 1)
            r = 6
    
            Set Rng = Sheets("Foglio1").Cells(r, "A")
            Set RngEnd = Sheets("Foglio1").Cells(Rows.Count, "A").End(xlUp)
            Set Rng = IIf(RngEnd.Row > Rng.Row, Sheets("Foglio1").Range(Rng, RngEnd), Rng)
        
            Rng.ClearContents
            Rng.Cells(1, 1).Select
            
            MsgBox "Pulizia completata.", vbInformation
            
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-16-2013
    Location
    Milan
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Trasparent color excel vba 2007 not working

    Hello Leith for your answer
    Supposig to have rows 1, 3 and 5 with yellow color. After I ran your macro this clean corretly all the rows with values starting from row 6. Now if I enter again values starting from row 6 I have row 6 with trasparent color, row 7 in yellow, row 8 traparent color , row 9 yellow color and so on.
    Do you have any idea for that
    Thanks

+ 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: 24
    Last Post: 08-24-2016, 05:10 AM
  2. Replies: 0
    Last Post: 06-12-2013, 09:44 AM
  3. Replies: 16
    Last Post: 11-21-2012, 07:20 PM
  4. Excel 2007 color options of fonts and backgrounds stopped working...
    By PelicanIII in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-05-2012, 12:40 PM
  5. Sorting by Cell Color, Font Color or Cell Icon in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-19-2007, 12:23 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