J
JohnBi
Hallo to everybody.
I found in Internet the following Vba code that works Ok, but I would like to modify as follows if possible as I am not very good with VBA
- instead of copy range A23:J23, and insert after the last row, copy Alastrow:Jlastrow and insert in the below row (for example from 25 to 26; then from 26 to 27, etc.
- in the cell D add a progressive number: if for example row 25, Cell D has 11, when copied to to row 26, cell D should have 12 and so on; when copied of row 27, cell D=13
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim NextCell As Range
Dim LastRow As Integer
Set WB = ActiveWorkbook
Set SH = WB.Sheets("UK")
Set rng = SH.Range("A23:J23")
Set NextCell = SH.Cells(Rows.Count, "A").End(xlUp)(2)
rng.Copy Destination:=NextCell
End Sub
I hope I have been able to explain what I would like to have.
Thanks for your much appreciate help.
Regards
John
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
I found in Internet the following Vba code that works Ok, but I would like to modify as follows if possible as I am not very good with VBA
- instead of copy range A23:J23, and insert after the last row, copy Alastrow:Jlastrow and insert in the below row (for example from 25 to 26; then from 26 to 27, etc.
- in the cell D add a progressive number: if for example row 25, Cell D has 11, when copied to to row 26, cell D should have 12 and so on; when copied of row 27, cell D=13
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim NextCell As Range
Dim LastRow As Integer
Set WB = ActiveWorkbook
Set SH = WB.Sheets("UK")
Set rng = SH.Range("A23:J23")
Set NextCell = SH.Cells(Rows.Count, "A").End(xlUp)(2)
rng.Copy Destination:=NextCell
End Sub
I hope I have been able to explain what I would like to have.
Thanks for your much appreciate help.
Regards
John
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-