VBA help - urgent :(

LS7

New Member
Joined
Apr 1, 2011
Messages
3
Hello!!
I need to finish something tonight, and I am hoping there is someone out there that can help me!

I have two sheets that I am working with - one is a work in progress sheet - it has about 240 columns, and about 90 rows. there are multiple calculations, but they are irrelevant.
the second sheet is the exact replica of the first - same exact column range. however, the second column is the one that stays there forever while the first one gets reused every week to enter other things.
I have macros that copy the data from the first sheet into the second sheet. then the users go into this second sheet and delete empty rows.
this is the simple macro they created for that:

Sheets("Transfer").Select
Rows("7:92").Select
Selection.Copy
Sheets("Current").Select
Rows("7:7").Select
Selection.Insert Shift:=xlDown
ActiveWindow.ScrollColumn = 1
Range("l7").Select
ActiveWindow.ScrollColumn = 1

So this inserts all of the data from the first tab into the next. It has to insert because this tab maintains about a year worth of stuff.

what I am trying to do is copy and insert only the rows that have a value.

Is this simple, or complicated??? I know how to do it if I was only copy pasting, but I can't figure it out when copy and inserting rows.

any help would be greatly appreciated!!!!
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

2k05gt

Board Regular
Joined
Sep 1, 2006
Messages
151
I am not sure what you are trying to do but this may give you a start?

Code:
Private Sub Worksheet_Change(ByVal Target As Range) 
    If Target.Cells.Count > 1 Then Exit Sub 
    If Target.Address = "$A$1" Then 
        If Target = "Completed" Then 
            Sheet2.Rows(10).Cut Destination:=Me.Range("A10") 
        End If 
    End If 
End Sub


This code requires that you have a status column that has an autofilter. It then filters for closed, copy the cells to completed and then deletes the extra rows.


Code:
Sub MoveClosed() 
    Sheets("Dashboard").Select 
    Selection.AutoFilter Field:=1, Criteria1:="Closed" 
    Range("A7").Select 
    Range(Selection, Selection.End(xlDown)).Select 
     '   Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, ActiveCell.Offset(0, 13).Range("A1")).Select 
    Selection.Copy 
    Sheets("Completed").Select 
    Range("A7").Select 
     '   The next 3 steps require that there be at least two rows of data in Completed
    Selection.End(xlDown).Select 
    ActiveCell.Offset(1, 0).Range("A1").Select 
    ActiveSheet.Paste 
    Sheets("Dashboard").Select 
    Application.CutCopyMode = False 
    Selection.EntireRow.Delete 
    Selection.AutoFilter Field:=1 
    ActiveCell.Select 
End Sub

But don't take my work for it, I am New at this too, I know you said urgent so I was trying to get you some options

And your screen name is LS7, so I figured you are a Car guy (2010 Camaro SS Maybe?)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,506
Messages
5,596,539
Members
414,077
Latest member
ammylar5

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