reinsermat
New Member
- Joined
- May 5, 2020
- Messages
- 20
- Office Version
- 365
- Platform
- Windows
Hello!
Sorry for bad english, I really hope, you do understand the question.
I have problem. My Paste works well, but I lost my "Next enter ID"
I need to show at sheet "P" (Sheet1) in Cell "A1" last number on a last row from sheet "p_koond" (Sheet2) Column A, but it does not appear as expected...
Anybody can offer a solution?
i'am very new on this, so every move takes a ton of time.
Thank you for any help!
Private Sub vaart_sis_GI_Click()
P_vaart_G.Hide
Dim SourceWS As Worksheet, DestWS As Worksheet
Dim NxtRw As Long
Set SourceWS = Sheets("P")
Set DestWS = Sheets("p_koond")
Application.ScreenUpdating = 0
NxtRw = DestWS.Cells.Find("*", , , , xlByRows, xlPrevious, , , False).Row + 1
SourceWS.Range("B3:N3").Copy
DestWS.Range("B" & NxtRw).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Range("D3:N6").Select
Range("N6").Activate
Selection.ClearContents
With Sheets("p_koond") '<--| reference "source" sheet- HERE START'S THE PROBLEM?
With Range(.Cells(.Rows.Count, "A").End(xlUp), _
.Cells(.Cells(.Rows.Count, "A").End(xlUp).Row, .Columns.Count).End(xlToLeft)) '<--| reference is range from its column A last not empty cell to this latter cell row last not empty cell
Worksheets("p").Range("A1").Resize(, .Columns.Count).Value = .Value '<--| paste values to "target" sheet starting from its cell A1
End With
End With
End Sub
Sorry for bad english, I really hope, you do understand the question.
I have problem. My Paste works well, but I lost my "Next enter ID"
I need to show at sheet "P" (Sheet1) in Cell "A1" last number on a last row from sheet "p_koond" (Sheet2) Column A, but it does not appear as expected...
Anybody can offer a solution?
i'am very new on this, so every move takes a ton of time.
Thank you for any help!
Private Sub vaart_sis_GI_Click()
P_vaart_G.Hide
Dim SourceWS As Worksheet, DestWS As Worksheet
Dim NxtRw As Long
Set SourceWS = Sheets("P")
Set DestWS = Sheets("p_koond")
Application.ScreenUpdating = 0
NxtRw = DestWS.Cells.Find("*", , , , xlByRows, xlPrevious, , , False).Row + 1
SourceWS.Range("B3:N3").Copy
DestWS.Range("B" & NxtRw).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Range("D3:N6").Select
Range("N6").Activate
Selection.ClearContents
With Sheets("p_koond") '<--| reference "source" sheet- HERE START'S THE PROBLEM?
With Range(.Cells(.Rows.Count, "A").End(xlUp), _
.Cells(.Cells(.Rows.Count, "A").End(xlUp).Row, .Columns.Count).End(xlToLeft)) '<--| reference is range from its column A last not empty cell to this latter cell row last not empty cell
Worksheets("p").Range("A1").Resize(, .Columns.Count).Value = .Value '<--| paste values to "target" sheet starting from its cell A1
End With
End With
End Sub