Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default automatically insert a row

Hello all
If anyone can help me with this query i'd be very grateful. I'll try and
explain it as simply as possible.

I have the following data. Columns A, B,C and E are manually populated,
columns D, and F are formulaic entry cells.

Sample data (normally about 1500 rows of data)

A B C D E
F
Cape Trust Discharge TCOV 50 55
a
Cape Tavor Load RELT 60 54 d
Aquabreeze Discharge OVOV 30 53 f
Bet Performer Discharge TCTO 27 45 r

If column C equals either RELT or OVOV i want to automatically add a new row
beneath each which contains the same manual entry data as the row being
copied (columns A, C and E), but also maintain the formula calc as in columns
D and F.

For column B which is a manual entry cell i'd like it to return a blank cell
rather than return the data from the copied cell.

i'm guessing this needs to be done as a macro, however, given my weakness
with macros if any one can help i'd be grateful if you can be as detailed as
possible. Many thanks in advance

Regards

Rich





  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default automatically insert a row

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

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 1 Step -1

If .Cells(i, "C").Value = "RELT" Or .Cells(i, "C").Value =
"OVOV" Then

.Rows(i + 1).Insert
.Rows(i).Copy .Rows(i + 1)
.Cells(i + 1, "B").Value = ""
End If
Next i
End With

End Sub

--
---
HTH

Bob


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



"Rich Hayes" wrote in message
...
Hello all
If anyone can help me with this query i'd be very grateful. I'll try and
explain it as simply as possible.

I have the following data. Columns A, B,C and E are manually populated,
columns D, and F are formulaic entry cells.

Sample data (normally about 1500 rows of data)

A B C D E
F
Cape Trust Discharge TCOV 50 55
a
Cape Tavor Load RELT 60 54 d
Aquabreeze Discharge OVOV 30 53 f
Bet Performer Discharge TCTO 27 45 r

If column C equals either RELT or OVOV i want to automatically add a new
row
beneath each which contains the same manual entry data as the row being
copied (columns A, C and E), but also maintain the formula calc as in
columns
D and F.

For column B which is a manual entry cell i'd like it to return a blank
cell
rather than return the data from the copied cell.

i'm guessing this needs to be done as a macro, however, given my weakness
with macros if any one can help i'd be grateful if you can be as detailed
as
possible. Many thanks in advance

Regards

Rich







  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default automatically insert a row

Hi Bob

Thanks for the quick response.

Can you explain please what this is doing, i've just copied it into VBA and
it is saying that it doesn't recognise Public Sub process dAta()

Also in the statement If.cells(i, "c"). value etc . Does the "c" denote
column or something else?

Thanks

Rich

"Bob Phillips" wrote:

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

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 1 Step -1

If .Cells(i, "C").Value = "RELT" Or .Cells(i, "C").Value =
"OVOV" Then

.Rows(i + 1).Insert
.Rows(i).Copy .Rows(i + 1)
.Cells(i + 1, "B").Value = ""
End If
Next i
End With

End Sub

--
---
HTH

Bob


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



"Rich Hayes" wrote in message
...
Hello all
If anyone can help me with this query i'd be very grateful. I'll try and
explain it as simply as possible.

I have the following data. Columns A, B,C and E are manually populated,
columns D, and F are formulaic entry cells.

Sample data (normally about 1500 rows of data)

A B C D E
F
Cape Trust Discharge TCOV 50 55
a
Cape Tavor Load RELT 60 54 d
Aquabreeze Discharge OVOV 30 53 f
Bet Performer Discharge TCTO 27 45 r

If column C equals either RELT or OVOV i want to automatically add a new
row
beneath each which contains the same manual entry data as the row being
copied (columns A, C and E), but also maintain the formula calc as in
columns
D and F.

For column B which is a manual entry cell i'd like it to return a blank
cell
rather than return the data from the copied cell.

i'm guessing this needs to be done as a macro, however, given my weakness
with macros if any one can help i'd be grateful if you can be as detailed
as
possible. Many thanks in advance

Regards

Rich








  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default automatically insert a row

There should be no space before Data.

And yes, the "C" refers to the column it is processing.

--
---
HTH

Bob


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



"Rich Hayes" wrote in message
...
Hi Bob

Thanks for the quick response.

Can you explain please what this is doing, i've just copied it into VBA
and
it is saying that it doesn't recognise Public Sub process dAta()

Also in the statement If.cells(i, "c"). value etc . Does the "c" denote
column or something else?

Thanks

Rich

"Bob Phillips" wrote:

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

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 1 Step -1

If .Cells(i, "C").Value = "RELT" Or .Cells(i, "C").Value =
"OVOV" Then

.Rows(i + 1).Insert
.Rows(i).Copy .Rows(i + 1)
.Cells(i + 1, "B").Value = ""
End If
Next i
End With

End Sub

--
---
HTH

Bob


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



"Rich Hayes" wrote in message
...
Hello all
If anyone can help me with this query i'd be very grateful. I'll try
and
explain it as simply as possible.

I have the following data. Columns A, B,C and E are manually populated,
columns D, and F are formulaic entry cells.

Sample data (normally about 1500 rows of data)

A B C D E
F
Cape Trust Discharge TCOV 50 55
a
Cape Tavor Load RELT 60 54 d
Aquabreeze Discharge OVOV 30 53 f
Bet Performer Discharge TCTO 27 45 r

If column C equals either RELT or OVOV i want to automatically add a
new
row
beneath each which contains the same manual entry data as the row being
copied (columns A, C and E), but also maintain the formula calc as in
columns
D and F.

For column B which is a manual entry cell i'd like it to return a blank
cell
rather than return the data from the copied cell.

i'm guessing this needs to be done as a macro, however, given my
weakness
with macros if any one can help i'd be grateful if you can be as
detailed
as
possible. Many thanks in advance

Regards

Rich










  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default automatically insert a row

Thankyou very much, it works just as i hoped

"Bob Phillips" wrote:

There should be no space before Data.

And yes, the "C" refers to the column it is processing.

--
---
HTH

Bob


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



"Rich Hayes" wrote in message
...
Hi Bob

Thanks for the quick response.

Can you explain please what this is doing, i've just copied it into VBA
and
it is saying that it doesn't recognise Public Sub process dAta()

Also in the statement If.cells(i, "c"). value etc . Does the "c" denote
column or something else?

Thanks

Rich

"Bob Phillips" wrote:

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

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 1 Step -1

If .Cells(i, "C").Value = "RELT" Or .Cells(i, "C").Value =
"OVOV" Then

.Rows(i + 1).Insert
.Rows(i).Copy .Rows(i + 1)
.Cells(i + 1, "B").Value = ""
End If
Next i
End With

End Sub

--
---
HTH

Bob


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



"Rich Hayes" wrote in message
...
Hello all
If anyone can help me with this query i'd be very grateful. I'll try
and
explain it as simply as possible.

I have the following data. Columns A, B,C and E are manually populated,
columns D, and F are formulaic entry cells.

Sample data (normally about 1500 rows of data)

A B C D E
F
Cape Trust Discharge TCOV 50 55
a
Cape Tavor Load RELT 60 54 d
Aquabreeze Discharge OVOV 30 53 f
Bet Performer Discharge TCTO 27 45 r

If column C equals either RELT or OVOV i want to automatically add a
new
row
beneath each which contains the same manual entry data as the row being
copied (columns A, C and E), but also maintain the formula calc as in
columns
D and F.

For column B which is a manual entry cell i'd like it to return a blank
cell
rather than return the data from the copied cell.

i'm guessing this needs to be done as a macro, however, given my
weakness
with macros if any one can help i'd be grateful if you can be as
detailed
as
possible. Many thanks in advance

Regards

Rich











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
how do I insert a blank row when a value changes, automatically mb5451 Excel Worksheet Functions 3 December 22nd 08 11:43 AM
Automatically insert lines? KJ Excel Discussion (Misc queries) 5 January 3rd 08 05:03 PM
automatically insert row Stephen Excel Discussion (Misc queries) 0 June 12th 06 02:29 PM
automatically insert footer jimmyp Excel Discussion (Misc queries) 3 May 15th 06 01:37 PM
Insert date automatically Rick Excel Discussion (Misc queries) 2 March 31st 05 11:49 PM


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