A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

add cell



 
 
Thread Tools Display Modes
  #1  
Old November 26th 04, 12:18 PM
ROLG
external usenet poster
 
Posts: n/a
Default add cell


i have a long list all in one column. the data in the first fifteen (1
thrue 15) is related and must be kept in sequence. the first fifteen
cells repeats with changes in its data for the next fifteen (16 thrue
30) and also must be kept in sequence. this repeats over and over for a
list of about 4000 cells.
what i need to do is this: i need to insert an empty
cell betwwn each group of fifteen cells.-to seperate them. between
15 & 16, 30 & 31 etc without disturbing the continuity of each 15 cell
grouping..

thankyou so much.


--
ROLG
------------------------------------------------------------------------
ROLG's Profile: http://www.excelforum.com/member.php...o&userid=16066
View this thread: http://www.excelforum.com/showthread...hreadid=320559

Ads
  #2  
Old November 26th 04, 03:09 PM
Dave Peterson
external usenet poster
 
Posts: n/a
Default

This worked ok for me:

Option Explicit
Sub testme()
Dim iCtr As Long
Dim LastRow As Long
Dim myRng As Range
With ActiveSheet
LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set myRng = Nothing
For iCtr = 16 To LastRow Step 15
If myRng Is Nothing Then
Set myRng = .Cells(iCtr, "A")
Else
Set myRng = Union(.Cells(iCtr, "A"), myRng)
End If
Next iCtr
End With

If myRng Is Nothing Then
'do nothing
Else
myRng.EntireRow.Insert
End If
End Sub



ROLG wrote:
>
> i have a long list all in one column. the data in the first fifteen (1
> thrue 15) is related and must be kept in sequence. the first fifteen
> cells repeats with changes in its data for the next fifteen (16 thrue
> 30) and also must be kept in sequence. this repeats over and over for a
> list of about 4000 cells.
> what i need to do is this: i need to insert an empty
> cell betwwn each group of fifteen cells.-to seperate them. between
> 15 & 16, 30 & 31 etc without disturbing the continuity of each 15 cell
> grouping..
>
> thankyou so much.
>
> --
> ROLG
> ------------------------------------------------------------------------
> ROLG's Profile: http://www.excelforum.com/member.php...o&userid=16066
> View this thread: http://www.excelforum.com/showthread...hreadid=320559


--

Dave Peterson
  #3  
Old November 26th 04, 06:34 PM
ROLG
external usenet poster
 
Posts: n/a
Default


thankyou for your very appreciated help.


--
ROLG
------------------------------------------------------------------------
ROLG's Profile: http://www.excelforum.com/member.php...o&userid=16066
View this thread: http://www.excelforum.com/showthread...hreadid=320559

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can't move a named cell without breaking a hyperlink to that cell Snakeye Links and Linking in Excel 3 January 26th 05 11:57 PM
Display cell value on a chart. Andrew Constantinidis Charts and Charting in Excel 1 January 8th 05 04:36 AM
How do I set a cell to "Empty" so that it does not display in a ch Ian Charts and Charting in Excel 3 January 7th 05 01:12 AM
make a cell empty based on condition mpierre Charts and Charting in Excel 2 December 29th 04 01:01 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 27th 04 11:31 PM


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


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