If Cell contains text Copy Row to another sheet

Ellsy

New Member
Joined
Jul 9, 2014
Messages
2
Hi,

I have been trying to crack this all afternoon to no avail - I've read every thread on it and not been able to customise the macros to work! In fact - i've never written a macro before!

If cells in Colomn E on Sheet '2014 Events' contain the text "Park" - Copy the Row to Sheet 'Park Events'

Hope that makes sense - any help muchly appreciated!
Thanks
E x
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try:

You will want to paste this into a module and run it from a button or keystroke.

Code:
Sub Organize()
Dim mycell As Range
Dim LastRow As Long

Application.ScreenUpdating = False

LastRow = Sheets("2014 Events").Range("E100000").End(xlUp).Row

For Each mycell In Sheets("2014 Events").Range("E2:E" & LastRow)
    If mycell.Value <> "Park" Then
        mycell.EntireRow.Hidden = True
    End If
Next mycell

Sheets("2014 Events").Range("A1:Z" & LastRow).SpecialCells(xlCellTypeVisible).Copy
Sheets("Park Events").Cells.PasteSpecial xlPasteValuesAndNumberFormats
Sheets("2014 Events").Rows("1:" & LastRow).Hidden = False
End Sub
 
Upvote 0
Hi Redwolfx,

Thanks for your help, I gave it a try but I couldn't it to work! Macros just don't seem to like me!

E x
 
Upvote 0
What happens when you try? Did you assign the macro to something? Button/Key combination?
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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