Excel VBA - Copy from one sheet to another with conditions

servox

New Member
Joined
Jul 6, 2022
Messages
1
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
Hi All

I'm trying to create a loop that will copy data from one sheet and paste into another sheet with conditions based on the value of that cell.

so I have 15 bingo number per row plus the ticket number

R1R1R1R1R1R2R2R2R2R2R3R3R3R3R3TICKET
31653728219233168839293642551
41057718863943657412284558792
241526680142433788726445669893

and need to copy them to sheet2 and place them in the correct column based on their value.

sheet2 has columns

1-910-1920-2930-3940-4950-5960-6970-980-90

repeated 3 times for the data from R1, R2 and R3 from sheet 1

so hopefully you understand what my goal is and the end result show look like this on sheet2

1-910-1920-2930-3940-4950-5960-6970-980-901-910-1920-2930-3940-4950-5960-6970-980-901-910-1920-2930-3940-4950-5960-6970-980-90number
3160005307282019233100680830902936425500000001
04100005707188060039430657400122804558079000002
02000415266080014243300078870026044566906900003

so hopefully someone can help point me in the right direction

thanks in advance
 

Attachments

  • Sheet 1.png
    Sheet 1.png
    20.9 KB · Views: 1
  • Sheet 2.JPG
    Sheet 2.JPG
    47.6 KB · Views: 1

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,176,168
Messages
5,901,732
Members
434,914
Latest member
mabek

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top