macro to cut contents from another sheet

gabriellejayde

New Member
Joined
Apr 18, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I recently asked for help with a macro and thanks to some of you- I got it to work. I need a little more help and then i've basically solved the biggest problem our warehouse has.
For the record, I'm a graphic designer and know almost nothing about VBA.

Here's what I'm trying to do:
We have contents one tab of a worksheet. We need to copy all of the new content and then paste it into an access database. The problem is, some of the contents being copied is a formula, and I was told that we can't easily paste values into a database.

So there's a button at the top with a macro that will copy the contents only (not the thousands of blank lines after the content), then paste the values into "sheet 2".

I would like that same button to then CUT all of the contents on sheet 2 (but just the filled in data - not any blank lines). The amount of rows will change all the time. Then our warehouse technician can just open the access database and hit paste.

I've gotten the macro to copy all of the contents (just the filled rows) from the first sheet, then paste the values into sheet 2. How do I then get it to cut the content of the filled rows from sheet 2?

Here's what I have:

Sub CopyInventory()
'
' CopyInventory Macro
' FROM INVENTORY MANAGER

'
Dim r As Long

Range("G1").Select
Selection.End(xlDown).Select
r = ActiveCell.Row
LR = Evaluate("MAX((G33:O5000<>"""")*ROW(G33:O5000))")
Range("F33:O" & LR).Copy

Sheets("Sheet2").Range("B1").PasteSpecial Paste:=xlPasteValues.

End Sub



Thank you all SO MUCH!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,430
Messages
6,124,851
Members
449,194
Latest member
HellScout

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