PDA

View Full Version : easy VBA seek for help!



hivincent
11-19-2019, 08:49 PM
If I want to copy the B1 to B5 in sheet1 regularly and repeatedly , and paste to Sheet4 (Inventory).
However , how to set a VBA to paste the data Sequentially in Sheet4?
Many thanks!!:(

hivincent
11-19-2019, 09:35 PM
:crying::crying::crying:

paulked
11-19-2019, 11:19 PM
Sub Macro1()
Dim Patience As Long
Patience = Sheet4.Cells(Rows.Count, 2).End(3).Row
If Patience <> 1 Then Patience = Patience + 1
Sheet1.Range("B1:B5").Copy Sheet4.Range("B" & Patience)
End Sub

hivincent
11-20-2019, 12:34 AM
Sub Macro1()
Dim Patience As Long
Patience = Sheet4.Cells(Rows.Count, 2).End(3).Row
If Patience <> 1 Then Patience = Patience + 1
Sheet1.Range("B1:B5").Copy Sheet4.Range("B" & Patience)
End Sub

Thanks so much!!
I want to learn more..... What is the different if i want to paste in transpose:yes:yes:yes

paulked
11-20-2019, 12:55 AM
If you want to learn then I suggest reading something like this https://www.educba.com/vba-transpose/
Here is an example of Transpose


Sub Macro1()
Dim Patience As Long
Patience = Sheet4.Cells(Rows.Count, 2).End(3).Row
If Patience <> 1 Then Patience = Patience + 1
Sheet1.Range("B1:B5").Copy
Sheet4.Range("B" & Patience).PasteSpecial Transpose:=True
End Sub

snb
11-20-2019, 03:04 AM
If I want to copy the B1 to B5 in sheet1 regularly and repeatedly , and paste to Sheet4 (Inventory).

In that case you have 100% redundant data in the Workbook.
Automation aims at efficiency and reducing redundancy.