LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default come on, somebody must know how to do this


NM, i got it to work! Instead of inserting the rows on the rngItem,
inserted the rows one cell below it. But there's something wrong still
It works fine for the first sheet, but somehow it stops working for th
other sheets.

I get "N/A" even though it shouldn't for the rest of the accounts. I
there a problem with the "next mysht"? Here's my new code...:

For Each mysht In ThisWorkbook.Worksheets
With mysht
Set rngData = .Range("A71"
.Range("A500").End(xlUp)).SpecialCells(xlCellTypeC onstants)
End With
With Workbooks("Intermediary - PWC").Worksheets("sheet3")
Set rngAccounts = .Range("A1:A" & Range("A65536").End(xlUp).Row)
End With

For i = rngData.Rows(rngData.Rows.Count).Row To _
rngData.Row Step -1
Set rngItem = rngData.Parent.Cells(i, rngData.Column)
Set rngout = rngAccounts.Find(What:=rngItem)

If rngout Is Nothing Then
rngItem.Offset(0, 2).Value = "N/A"

Else
Set rngcopy = rngout.Offset(0, 1)
Set rng = Range(rngcopy, _
rngcopy.End(xlDown).End(xlToRight))
sAdd = rngItem.Address(o, o, xlA1, True)
Set rngin = rngItem.Offset(1, 0)
rngin.EntireRow.Resize(rng.Rows.Count).Insert xlShiftDown
rng.Copy Destination:=Range(sAdd).Offset(0, 2)
End If
Next i
Next mysht
End Su

--
Sethaholi
-----------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...fo&userid=2511
View this thread: http://www.excelforum.com/showthread.php?threadid=39395

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"