Results 1 to 4 of 4

Thread: HELP: Ms Excel - MACRO

  1. #1
    Rahym.Zulfiqar.Aly is offline Member
    Last Online
    20th February 2010 @ 06:21 PM
    Join Date
    12 Jul 2008
    Posts
    1,913
    Threads
    243
    Thanked
    9

    Exclamation HELP: Ms Excel - MACRO

    Assalam-O-Alaikum,
    Janab ek aisa MACRO banana hai k jiss say ROWs Hide ho jaye lekin sirf Text and Blank Rows

    Jiss Row may Number hoon woh hide nahi honi chahiye !!!

    Kia aisa Macro ban sakta hai ?
    ya agar formula ho tau woh bata dain

    i a waiting for reply

    Snap shot is attached.
    Attached Images Attached Images  

  2. #2
    flydreamz's Avatar
    flydreamz is offline Senior Member+
    Last Online
    14th September 2012 @ 12:53 PM
    Join Date
    01 Jun 2009
    Location
    In the Heart of my Country
    Posts
    293
    Threads
    59
    Credits
    0
    Thanked
    29

    Default

    Yes Bana saktay ho, is kay liay VB progriming (VB Editor) use karna hoga.

  3. #3
    Join Date
    15 Jun 2007
    Location
    ***************
    Gender
    Female
    Posts
    94
    Threads
    26
    Thanked
    2

    Default

    (1) Your range always starts in A2.
    (2) Your range columns are from A thru D.
    (3) You would only want to hide rows where no data exists in any of the 4 possible cells (columns A thru D in this example) on a given row.
    (4) The last row that contains data will always be populated in column A.


    Sub HideRows()
    Application.ScreenUpdating = False
    Dim i As Integer
    Dim RStart As Range
    Dim REnd As Range
    Set RStart = Range("A2")
    Set REnd = Sheets("YourSheetName").Range("A65536").End(xlUp). Offset(0, 3)
    Range(RStart, REnd).Select
    On Error Resume Next
    With Selection
    .EntireRow.Hidden = False
    For i = 1 To .Rows.Count
    If WorksheetFunction.CountBlank(.Rows(i)) = 4 Then
    .Rows(i).EntireRow.Hidden = True
    End If
    Next i
    End With
    Set RStart = Nothing
    Set REnd = Nothing
    Range("A1").Select
    Application.ScreenUpdating = True
    End Sub

  4. #4
    Join Date
    15 Jun 2007
    Location
    ***************
    Gender
    Female
    Posts
    94
    Threads
    26
    Credits
    1,383
    Thanked
    2

    Default

    Sub HideBlankRows()
    Dim rng As Range, cell As Range
    Set rng = Application.Intersect(ActiveSheet.UsedRange, Range("A:A"))
    For Each cell In rng
    If Application.CountA(cell.EntireRow) = 0 Then cell.EntireRow.Hidden = True
    Next
    End Sub

Similar Threads

  1. Macro excel in video tutorial
    By mfranakar in forum Videos
    Replies: 10
    Last Post: 12th February 2019, 02:10 PM
  2. Excel Macro help
    By Rizwan Anjum in forum Ask an Expert
    Replies: 0
    Last Post: 20th July 2015, 11:46 AM
  3. What is macro
    By Nadeem Ahmed Kh in forum Ask an Expert
    Replies: 5
    Last Post: 17th April 2013, 10:28 AM
  4. What is Macro in Excel
    By majid_1star in forum Ask an Expert
    Replies: 1
    Last Post: 16th September 2011, 09:39 PM
  5. need macro excel
    By alim khan in forum Ask an Expert
    Replies: 0
    Last Post: 28th August 2011, 09:17 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
  •