Consulting

Results 1 to 4 of 4

Thread: VBA - Copy Paste data to another sheet based on criteria

  1. #1

    Exclamation VBA - Copy Paste data to another sheet based on criteria

    All the data is in sheet 1, I want to compare the value at column C and D. If the value at column C is less than or equal to column D, copy the value in column B, E and F to sheet 2. The data will be paste special (only value) and to the desired columns shown below. The code will continue until there is no data left in sheet 1 column B.

    If criteria is meet (value at column C <= Column D) :
    Sheet 1 Sheet 2
    Copy data at column B -> Paste at Column C
    Copy data at column E -> Paste at Column B
    Copy data at column F -> Paste at Column D

    There will be a button in sheet 1, when the button is pressed, all the existing data in the table (sheet 2) will be deleted before pasting a new one.

    Please help! Thank you!

    Worksheet1.xlsx

  2. #2
    try this
    Attached Files Attached Files

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    …and a Power Query offering attached.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    Thank you so much arnelgp and p45cal!

Tags for this Thread

Posting Permissions

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