Hi All
I want to insert rows based on the coloumn F (has 6.00 on it)
2061 01.08.2009 01.08.2009 6.00
Since the coloumn F has value 6 on it, i want to insert 5 rows below the current row
Could you please help me doing it?
Million Thanks
sramchan
Hi All
I want to insert rows based on the coloumn F (has 6.00 on it)
2061 01.08.2009 01.08.2009 6.00
Since the coloumn F has value 6 on it, i want to insert 5 rows below the current row
Could you please help me doing it?
Million Thanks
sramchan
Last edited by sramchan; 10-31-2009 at 06:51 AM.
Macros, Macros Macros.... :D
Dim MyLine As Integer
Sub AddRow_ColumnF(Line As Integer, Q As Integer)
Rows(Line + 1 & ":" & Line + Q).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
Call AddRow_ColumnF(MyLine, Range("F" & MyLine).Value)
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MyLine = ActiveCell.Row
End Sub
Ps: Put in the sheet you using.
This is it!!!!
Renato Lacerda![]()
Thanks for replying renatolacerda
Sorry for being dumb
Could you please explain how do i create the macro
I go to tools --> Macro --> "InsertRow"
It then opens up a visual basic editor
do i put your code inside it?
can someone help?
Hi sramchan
The code given you (not wrapped in code tags) is not complete. If you are willing to show me what you have and what you wish it to look like (before and after), perhaps I can help.
John
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
this is how my file looks like
If i have number 2 on the last coloumn, i want one more row and the dates need to be incremented by 1.857 2050 Standby X 01.08.2009 01.08.2009 2.00
975 2050 Standby X 01.08.2009 01.08.2009 2.00
611 2050 Standby X 01.08.2009 01.08.2009 2.00
277 2050 Standby X 01.08.2009 01.08.2009 2.00
934 2050 Standby X 01.08.2009 01.08.2009 3.00
thanks for the help857 2050 Standby X 01.08.2009 01.08.2009 1.00
857 2050 Standby X 02.08.2009 02.08.2009 1.00
975 2050 Standby X 01.08.2009 01.08.2009 1.00
975 2050 Standby X 02.08.2009 02.08.2009 1.00
611 2050 Standby X 01.08.2009 01.08.2009 1.00
611 2050 Standby X 02.08.2009 02.08.2009 1.00
277 2050 Standby X 01.08.2009 01.08.2009 1.00
277 2050 Standby X 02.08.2009 02.08.2009 1.00
934 2050 Standby X 01.08.2009 01.08.2009 1.00
934 2050 Standby X 02.08.2009 02.08.2009 1.00
934 2050 Standby X 03.08.2009 03.08.2009 1.00
Last edited by sramchan; 11-02-2009 at 09:32 AM.
is there any other information that is needed
Yes; post a workbook.
Entia non sunt multiplicanda sine necessitate
Please find the data i have right now. (sample_input)
and the output expected from it (sample_output)
Hi sramchan
The attached workbook has procedures that appears to accomplish what you're trying to do except that I can't seem to get the leading 0's on the date fields. Sheet1 is your original input, Sheet3 is your original output. All the activity of the procedures take place on Sheet2.
See if it works for you and let me know of any issues. John
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks