VBA help

Donai

Well-known Member
Joined
Mar 28, 2009
Messages
543
Hi, i need a VBA code that will copy the header row under data set, so in the below example the header row will be copied to row 12

Excel Workbook
ABCDEFGHI
5Client CodeDebt >60daysSend Letter?P.ArrangementRingNo ActionPassive(60 days)Aggressive (3rd time)Legal
6Test16,271.00
7Test21,210.00
8Test31,600.00
9Test4110.00
10Test52,340.00
11Test61,760.00
Sheet1
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
See if this gets you started:

<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> foo()<br>    <SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>        i = Cells(Rows.Count, "A").End(xlUp).Row<br>            Range("A1:I1").Copy Cells(i, "A")<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0
See if this gets you started:

Sub foo()
Dim i As Long
i = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:I1").Copy Cells(i, "A")
End Sub


HTH,

The code seems to remove Test 6 row and copies the data to that row, i need the header row to go underneath that the last data row
 
Upvote 0
By adding +1 it works. Thanks


Sub foo()
Dim i As Long
i = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("A5:I5").Copy Cells(i, "A")
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,317
Members
452,905
Latest member
deadwings

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