Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I've got this which works fine. Set sh1 = ActiveWorkbook.Sheets("Data") Set sh2 = ActiveWorkbook.Sheets("UK") 'H1 For Each c In sh1.Range("A1:A" & lr2) If c.Value = "H1" Then lr1 = sh2.Range("A" & Rows.Count).End(xlUp).Row c.EntireRow.Cut Sheets("UK").Select Rows(lr1 + 1).Select ActiveSheet.Paste End If Next 'H2 For Each c In sh1.Range("A1:A" & lr2) If c.Value = "H2" Then lr1 = sh2.Range("A" & Rows.Count).End(xlUp).Row c.EntireRow.Cut Sheets("UK").Select Rows(lr1 + 1).Select ActiveSheet.Paste End If Next 'H3 For Each c In sh1.Range("A1:A" & lr2) If c.Value = "H3" Then lr1 = sh2.Range("A" & Rows.Count).End(xlUp).Row c.EntireRow.Cut Sheets("UK").Select Rows(lr1 + 1).Select ActiveSheet.Paste End If Next But as I'm looking at the same data in Sh1. Can this be made shorter by some sort of Or here If c.Value = "H1" Then Something like if c.Value = "H1","H2","H3" then? Thanks Carl |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you make cells smaller? | Charts and Charting in Excel | |||
Make ribbon Icons smaller | Excel Discussion (Misc queries) | |||
How do I size a worksheet ? ( make smaller ) | Excel Discussion (Misc queries) | |||
How to split worksheet to make smaller | Excel Worksheet Functions | |||
Make Values Smaller Q | Excel Worksheet Functions |