Results 1 to 14 of 14

Flip Rows and Columns and Conditional Formatting - Please Help

Threaded View

  1. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Flip Rows and Columns and Conditional Formatting - Please Help

    See the attached file.

    I used the macro below to get the result.

    Sub CONVERTROWSTOCOL_Oeldere_revisted()
    
    Dim rsht1 As Long, rsht2 As Long, i As Long, col As Long, wsTest As Worksheet
    
    'check if sheet "ouput" already exist
    
    Const strSheetName As String = "Output"
     
    Set wsTest = Nothing
    On Error Resume Next
    Set wsTest = ActiveWorkbook.Worksheets(strSheetName)
    On Error GoTo 0
     
    If wsTest Is Nothing Then
        Worksheets.Add.Name = strSheetName
    End If
    
       
       With Sheets("Output")
        .UsedRange.ClearContents
        .Range("A1:D1").Value = Array("Work", "Choise", "Name", "value")
    
        End With
        
        
        rsht1 = Sheets("sheet2").Range("A" & Rows.Count).End(xlUp).Row
        rsht2 = Sheets("Output").Range("A" & Rows.Count).End(xlUp).Row
        col = 3
        
        For i = 4 To rsht1
            
            Do While Sheets("sheet2").Cells(3, col).Value <> ""
                rsht2 = rsht2 + 1
                Sheets("Output").Range("A" & rsht2).Value = Sheets("sheet2").Range("A" & i).Value
                Sheets("Output").Range("B" & rsht2).Value = Sheets("sheet2").Range("B" & i).Value
                Sheets("Output").Range("C" & rsht2).Value = Sheets("sheet2").Cells(3, col).Value
                Sheets("Output").Range("D" & rsht2).Value = Sheets("sheet2").Cells(i, col).Value
                
         
                col = col + 1
            Loop
            col = 3
        Next
      With Sheets("Output")
    '   .Range("D2:D" & .Rows.Count).SpecialCells(4).EntireRow.Delete
       Columns("A:Z").EntireColumn.AutoFit
        End With
    End Sub
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Conditional formatting for multiple rows and columns
    By jimboryan in forum Excel General
    Replies: 2
    Last Post: 04-17-2013, 01:38 PM
  2. Conditional Formatting - Multiple rows/columns
    By Phillydog in forum Excel General
    Replies: 4
    Last Post: 03-21-2011, 04:50 PM
  3. How to flip rows & columns?
    By swee'pea in forum Excel General
    Replies: 2
    Last Post: 02-18-2010, 04:05 PM
  4. Conditional formatting to colour rows/columns
    By Bekanator in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-11-2006, 06:24 PM
  5. Replies: 5
    Last Post: 07-14-2006, 04:03 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