Copy and Paste range into separate worksheet

Schaefer156

New Member
Joined
Jul 11, 2022
Messages
8
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello,
I am looking to figure out this VBA code I am trying to write for a project I am working on, I have it that it will search for a certain text in column L, once it finds that certain word I want it to copy and paste columns A-K down from the row that it found the certain word until a blank cell and only copy those row, for example, I have the code search for K3 and when it finds it it will copy rows 6-11 to the next worksheet. And I know I can do it by setting the range but if someone comes in and adds a row it will mess up the range.
1657634212517.png
1657634393300.png
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You are very welcome. :)
Hello Mumps, sorry to bother, the code works great but I only am having one issue with it when I get to a section that I would not like in the list I noticed it copied all the way down to K3.4 and so on when there is a gap in between K3.4 and K3.5 it will copy all the way down to K3.5, is there a possible fix for this I'm new to VBA so I'm not great at it.

1657638603476.png
 
Upvote 0
I guess the fastest and easiest way to solve the problem without having to change the macro, would be to insert a character such as a hyphen in the blank cell to the right of "Date". If that's not possible, please let me know.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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
Back
Top