Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Insert blank row above populated cell

Hi there, I have a column mostly consisting of blank cells. What I
need is some vba that finds any populated cells and then inserts a new
row above it. Is the best way to do this by using ISTEXT, or NOT
(ISBLANK). I'm sure the answer is very simple, but not for me! Any
advice would be really appreciated. Thank u, BJ

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Insert blank row above populated cell

try
Sub insertifnotblank()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -1
If Len(Cells(i, "a")) 1 Then Rows(i).Insert
Next i
End Sub

--
Don Guillett
SalesAid Software

"Bevy" wrote in message
oups.com...
Hi there, I have a column mostly consisting of blank cells. What I
need is some vba that finds any populated cells and then inserts a new
row above it. Is the best way to do this by using ISTEXT, or NOT
(ISBLANK). I'm sure the answer is very simple, but not for me! Any
advice would be really appreciated. Thank u, BJ



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Insert blank row above populated cell

Thanks again Don,

I have just demonstrated to you the extent of my ignorance! I am going
to demand that I go on a course, or that they buy me a very good book!
:)


Don Guillett wrote:
try
Sub insertifnotblank()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -1
If Len(Cells(i, "a")) 1 Then Rows(i).Insert
Next i
End Sub

--
Don Guillett
SalesAid Software

"Bevy" wrote in message
oups.com...
Hi there, I have a column mostly consisting of blank cells. What I
need is some vba that finds any populated cells and then inserts a new
row above it. Is the best way to do this by using ISTEXT, or NOT
(ISBLANK). I'm sure the answer is very simple, but not for me! Any
advice would be really appreciated. Thank u, BJ


Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding cells but leaving blank if not populated Scoober Excel Worksheet Functions 2 November 5th 09 08:08 AM
How do I insert a work sheet populated with data into another? GMPierre Excel Worksheet Functions 1 July 17th 08 09:12 PM
First populated cell in row array/ Last populated cell in row arra Skyscan Excel Worksheet Functions 7 May 29th 08 05:20 PM
formula for a cell which is blank returns populated cell Gracey1 Excel Discussion (Misc queries) 1 February 2nd 07 09:17 AM
Auto insert Date & Time when another cell is populated Trixie Excel Discussion (Misc queries) 1 October 2nd 06 03:59 AM


All times are GMT +1. The time now is 01:49 PM.

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

About Us

"It's about Microsoft Excel"