cut raw from...

User avatar
sal21
PlatinumLounger
Posts: 3611
Joined: 26 Apr 2010, 17:36

cut raw from...

Post by sal21 »

I need to cut a range from A2 to AB2, from sheet1 and append to the last not filled raw, base column A, copy the cutted range in A, naturally move up the not blank raw from sheet1...

User avatar
HansV
Administrator
Posts: 71516
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: cut raw from...

Post by HansV »

I assume that you mean row, not raw.
To which sheet do you want to append?
Regards,
Hans

User avatar
sal21
PlatinumLounger
Posts: 3611
Joined: 26 Apr 2010, 17:36

Re: cut raw from...

Post by sal21 »

HansV wrote:
12 May 2021, 15:35
I assume that you mean row, not raw.
To which sheet do you want to append?
sure row!

sorry, ws1 to ws2

just set:

Set WS1 = Sheets("foglio1")
Set WS2 = Sheets("foglio2")

note:
i need to copy from ws1 to ws2, only value, not formula and other

User avatar
HansV
Administrator
Posts: 71516
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: cut raw from...

Post by HansV »

Code: Select all

Sub CutRow()
    Dim WS1 As Worksheet
    Dim WS2 As Worksheet
    Dim Rng As Range
    Set WS1 = Worksheets("foglio1")
    Set WS2 = Worksheets("foglio2")
    Set Rng = WS2.Range("A" & WS2.Rows.Count).End(xlUp).Offset(1)
    Rng.Resize(1, 28).Value = WS1.Range("A2").Resize(1, 28).Value
    WS1.Range("A2").EntireRow.Delete
End Sub
Regards,
Hans

User avatar
sal21
PlatinumLounger
Posts: 3611
Joined: 26 Apr 2010, 17:36

Re: cut raw from...

Post by sal21 »

HansV wrote:
12 May 2021, 17:13

Code: Select all

Sub CutRow()
    Dim WS1 As Worksheet
    Dim WS2 As Worksheet
    Dim Rng As Range
    Set WS1 = Worksheets("foglio1")
    Set WS2 = Worksheets("foglio2")
    Set Rng = WS2.Range("A" & WS2.Rows.Count).End(xlUp).Offset(1)
    Rng.Resize(1, 28).Value = WS1.Range("A2").Resize(1, 28).Value
    WS1.Range("A2").EntireRow.Delete
End Sub
sorry but i need to paste in Column B of sheet ws2, not in A

in column A of sheet WS2, i need to insert the current date, for each row pasted.

in other case the code work well!

User avatar
HansV
Administrator
Posts: 71516
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: cut raw from...

Post by HansV »

You can easily modify the code for that.
Regards,
Hans