Search text on merge cells and hide row for blank cells

francozzy

New Member
Joined
Apr 3, 2018
Messages
26
Hi,

I have some table as sample for the real table issue like below :

image.png



i would like copy the whole tables into new worksheet,
and then split the two table split into two sheet,
let say split into table A(first table) and table B(second table)

After copying and splitting, i want to search for non blank cell on table A start the third row from column H to V,
if i find blank cell, it will follow by hide the row with the blank cell
and table A will be show like below:
image.png


and same as for table B,
but start from the fourth row from column H to V and will show like below :

image.png



I want to make all the step using Macro,
Is that possible to the reseult make like as table A & B ?
cause i'm stuck on search text in merge cell and hide the table row if found blank cell within merge cell

FYI, for the source table cannot be changed how to display, coz it's already presented for the whole day in a month into one sheet, and each sheet represent each month within a year,
So total will be 12 sheets on one worksheet.

Anyone can help ?

Thank You.
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
@francozzy Please test for me (I will not be putting formula in final solution - just want to test if the cells are truly empty etc)

Place this formula in W3 and copy down

=IF(COUNTA(H3:V3)=0,"HIDE","")

Are the correct rows marked with "HIDE"
 
Upvote 0
i would like copy the whole tables into new workSHEET,
and then split the two table split into two sheet,
let say split into table A(first table) and table B(second table)

new workSHEET or new workBOOK ?
 
Upvote 0
Does this copy the sheet correctly for you?

Paste code into standard module
Select the sheet to be copied
Run the code
Select a cell when told to do so

Code:
Sub copySheet()
    Dim a As Long, Cel As Range, newBook As Workbook
    Set Cel = Application.InputBox("select first cell of table 2 and click ok", , , , , , , 8)
    Set Cel = ActiveSheet.Cells(Cel.Row, 1)
'add workbook
    Set newBook = Workbooks.Add
'copy sheets twice
    With Cel.Parent
        For a = 1 To 2
            .Copy Before:=newBook.Sheets(1)
        Next
    End With
'delete table 1
    With newBook.Sheets(1)
        .Range("A1").Resize(Cel.Row - 1).EntireRow.Delete
    End With
'delete table 2
    With newBook.Sheets(2)
        .Range(Cel.Address, .Cells(Rows.Count, 1)).EntireRow.Delete
    End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top