View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Carlos Carlos is offline
external usenet poster
 
Posts: 84
Default How to make this code smaller

I'm sure it's not as it started with my code.. :-)

Will come back and took a look at your coding when I've got more time and
knowledge to understand it.

Thanks very much for your input.

Still on a very stiff learning curve.

Carl

"Don Guillett" wrote:

NOT the most efficient way but whatever makes you happy.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Carlos" wrote in message
...
Thanks to all for replying.

Stefi's worked first time and tidied it up to where I needed it to be.

Many thanks
Carl

"p45cal" wrote:


Untested:For Each c In sh1.Range("A1:A" & lr2)
If c.Value = "H1" Or c.Value = "H2" Or c.Value = "H3" Then
lr1 = sh2.Range("A" & Rows.Count).End(xlUp).Row
c.EntireRow.Cut Sheets("UK").Rows(lr1 + 1)
End If
Next
or:For Each c In sh1.Range("A1:A" & lr2)
If c.Value = "H1" Or c.Value = "H2" Or c.Value = "H3" Then
c.EntireRow.Cut Sheets("UK").Rows(sh2.Range("A" &
Rows.Count).End(xlUp).Row + 1)
Next
Result won't necessarily be in the same order.
In both snippets I've tried shortening you cut/paste - again untested.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile:
http://www.thecodecage.com/forumz/member.php?userid=558
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=131534