View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_366_] joel[_366_] is offline
external usenet poster
 
Posts: 1
Default Count rows b/w values and insert that # of rows elsewhere


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