LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default row insertion before/after

Hi,

I want to insert a row if the value in col.a and col. b of any specific row
is different.
Please help me out without least posssible chang in my code since as a
beginner i won't be able to grasp the changes easily


Also please tellme how to insert a row previous to the current row. my code i
think is inserting row after the current row
Sub Testinsert()

Dim x, y As Integer
x = ActiveCell.Row
x = 1

Do While Cells(x, 1).Value < " "
y = x + 1
If Cells(x, 1).Value < Cells(x, 2).Value Then
Cell.EntireRow.Insert
Cells(y, 1) = "a" 'assuming new inserted rowindex to be y(ie x+1)
Cells(y, 2) = "b"
End If
x = x + 1
Loop

End Sub

Thanks,thanks, thanks a lot

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200910/1

 
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
FORMULAR INSERTION Kanmi Excel Programming 3 September 29th 09 05:13 AM
Row Insertion mlockman Excel Discussion (Misc queries) 0 April 17th 09 03:33 PM
Rows Insertion b166er Excel Worksheet Functions 1 June 22nd 06 04:41 PM
Rows Insertion b166er Excel Discussion (Misc queries) 1 June 22nd 06 03:35 PM
How to use QueryTable with insertion sql ou Excel Programming 1 August 18th 04 12:20 PM


All times are GMT +1. The time now is 06:34 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"