View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
robin robin is offline
external usenet poster
 
Posts: 210
Default Count rows b/w values and insert that # of rows elsewhere

Thank you Joel.

At first glance I was a little confused because you weren't actually
"counting." But I now get that you are taking row numbers of the particular
values and subtracting for the previous values' rows. Very clever. This will
work!

Thank you again,
Robin

"joel" wrote:


try something like this. The find method alsop has an after (to find
something after a certain cell) . I'm not sure if A,L,I occurs multiple
number of times and you need to use After.

With Sheets("sheet1")
Found = True
set c1 = .columns("A").find(what:="A", _
lookin:=xlvalues,lookat:=xlwhole)
if c1 is nothing then
found = false
else
intRowCountA = c1.row
end if

set c2 = .columns("A").find(what:="L", _
lookin:=xlvalues,lookat:=xlwhole)
if c2 is nothing then
Found = false
else
intRowCountL = c2.row
end if

set c3 = .columns("A").find(what:="I", _
lookin:=xlvalues,lookat:=xlwhole)
if C3 is nothing then
Found = false
else
intRowCountI = c3.row
end if

if Found = true then

end if

AtoL = intRowCountL - intRowCountA + 1
end with


with sheets("sheet2")

StartRow = 10

.rows(StartRow & ":" & AtoL).insert
end with


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=163841

Microsoft Office Help

.