Consulting

Results 1 to 6 of 6

Thread: easy VBA seek for help!

  1. #1

    easy VBA seek for help!

    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!!

  2. #2

  3. #3
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    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
    Semper in excretia sumus; solum profundum variat.

  4. #4
    Quote Originally Posted by paulked View Post
    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

  5. #5
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    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
    Semper in excretia sumus; solum profundum variat.

  6. #6
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,642
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •