Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Can anyone help with the following macro?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stanleysi - 24 May 2006 08:09 GMT
Hi all,

Think this should be quite simple for some the guru's here :D

What I have is this

A    B   C   D   E
1      X
2      Y   Y   Y
3      Y   Y   Y
4      Z
5      M  M   M

I need the macro to insert a row between A3 and A4 so that the sheet
will look like this when run
A    B   C   D   E
1      (blank row)
2      X
3      Y   Y   Y
4      Y   Y   Y
5      (blank row)
6      Z
7      M  M   M

Thanks

Signature

stanleysi

Ivan Raiminius - 24 May 2006 09:16 GMT
Hi,

you inserted two rows in your example, but need to insert one row?

Depending on what condition?

Regards,
Ivan
stanleysi - 24 May 2006 10:44 GMT
Hi,

Just to clarify, yes there should be two rows inserted. What the macr
needs to do is to check the values in the 2nd column and if it is "
(empty) then insert a row ABOVE that.

Hope that clarifies

Thanks

Sta
Ivan Raiminius - 24 May 2006 11:51 GMT
Hi Stan,

Sub InsertRow()
intersect(range("B:B"),activesheet.usedrange).SpecialCells(xlCellTypeBlanks).entirerow.insert
end sub

Regards,
Ivan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.