Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Information Required on Insertion of series

I have a series of numbers

1234
1236
1239
1240
1243
1245


now i want that a row should get inserted autometically if the series
is not in line

like
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245

More over i want that the text of the new Inserted row should be in
red color.

Is it possible.

Thanks in Advance

Regards

Akash

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Information Required on Insertion of series

One way:

Public Sub Fill_in_red()
Dim i As Long
Dim dTemp As Double
With Sheets(1).Columns(1)
For i = .Cells(.Rows.Count, 1).End(xlUp).Row To 2 Step -1
dTemp = .Cells(i).Value - 1
Do Until dTemp <= .Cells(i - 1).Value
.Cells(i).EntireRow.Insert Shift:=xlShiftDown
.Cells(i).Value = dTemp
.Cells(i).Font.ColorIndex = 3
dTemp = dTemp - 1
Loop
Next i
End With
End Sub


In article . com,
"Akash" wrote:

I have a series of numbers

1234
1236
1239
1240
1243
1245


now i want that a row should get inserted autometically if the series
is not in line

like
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245

More over i want that the text of the new Inserted row should be in
red color.

Is it possible.

Thanks in Advance

Regards

Akash

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Information Required on Insertion of series

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
Dim iStart As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 2 Step -1
Do While .Cells(i, TEST_COLUMN).Value < .Cells(i - 1,
TEST_COLUMN).Value + 1
.Rows(i).Insert
.Cells(i, TEST_COLUMN).Value = .Cells(i + 1,
TEST_COLUMN).Value - 1
.Cells(i, TEST_COLUMN).Interior.ColorIndex = 3
Loop
Next i

End With

End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Akash" wrote in message
ups.com...
I have a series of numbers

1234
1236
1239
1240
1243
1245


now i want that a row should get inserted autometically if the series
is not in line

like
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245

More over i want that the text of the new Inserted row should be in
red color.

Is it possible.

Thanks in Advance

Regards

Akash



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
Required information in a cell Steve New Users to Excel 4 November 28th 07 01:22 PM
Information Required Akash Excel Programming 1 February 10th 07 12:27 PM
Required Information Mike J Excel Discussion (Misc queries) 1 May 22nd 06 05:57 AM
Changing series information for approximately 60 series in a workb Barb Reinhardt Charts and Charting in Excel 2 January 18th 06 10:22 PM
Can't quite get this syntax to bring in the required information. Sharlene England Excel Programming 1 November 29th 03 08:47 AM


All times are GMT +1. The time now is 09:59 AM.

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"