add new row macro?

lpking2005

Board Regular
Joined
Mar 21, 2011
Messages
140
hi,

Can anyone help me, I want a button on a sheet which once clicked, will
add a row at the bottom each time,
but I need newly created cells to retain the same size and conditional formatting,
Note that the the two columns which are coloured are all separate combo boxes.


This is what i need to copy to the bottom each time....
5588347962_280a4612cb_b.jpg
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
hi

i had the same problem once

below the end of the visual basic code enter the word Next and that should do the trick, but enter it before end sub eg below.

Code:
Sub adddetails()
'
' adddetails Macro
'

sourcerows = Array(12, 13, 17, 18, 19, 20)
targetareas = Array("G", "I", "M", "O", "Q", "S")
targetrow = Sheets("Customer Details").Range("G" & Rows.Count).End(xlUp).Offset(1).Row
Sheets("Home Page").Select
For i = LBound(sourcerows) To UBound(sourcerows)
    Range("Q" & sourcerows(i)).Resize(1, 2).Copy _
        Destination:=Sheets("Customer Details").Range(targetareas(i) & targetrow)
    
    
Next

    
 End Sub

kristian

any help providable by my limitations

oh year no data provided by you for cells and rows
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,151
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top