ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy 2 application references (https://www.excelbanter.com/excel-programming/292692-copy-2-application-references.html)

Dominique Feteau

Copy 2 application references
 
I have a billing sheet where I want to filter to the type of billing i want
shown, copy the columns that i need and paste them into a new workbook. To
make this easier, I created a defined name for all the columns that i want
copied and named them "submitted". In the macro I created, it does that and
does a little editing as well. Here is the macro that i'm using:

Sub Billing()
'
' Billing Macro
'
Selection.AutoFilter Field:=8, Criteria1:="1"
Application.Goto Reference:="Submitted"
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Cells.Select
Cells.EntireColumn.AutoFit
Columns("M:M").Select
Application.CutCopyMode = False
Selection.Cut
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
End Sub

The one other thing that I want is to include the amount, that has its own
defined name because this will change from month to month. Is there a way
for this macro to copy both references "submitted" and another one called
"feb" into the same worksheet?

Dominique



Dominique Feteau

Copy 2 application references
 
I figured out how to do what I needed to do below by just adding the next
defined name in the reference field (e.g. Application.Goto
Reference:="Submitted,Feb") but now what I want to do is setup a message box
that automatically fills in those 2 references.

Can someone help me out?
Niq

"Dominique Feteau" wrote in message
...
I have a billing sheet where I want to filter to the type of billing i

want
shown, copy the columns that i need and paste them into a new workbook.

To
make this easier, I created a defined name for all the columns that i want
copied and named them "submitted". In the macro I created, it does that

and
does a little editing as well. Here is the macro that i'm using:

Sub Billing()
'
' Billing Macro
'
Selection.AutoFilter Field:=8, Criteria1:="1"
Application.Goto Reference:="Submitted"
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Cells.Select
Cells.EntireColumn.AutoFit
Columns("M:M").Select
Application.CutCopyMode = False
Selection.Cut
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
End Sub

The one other thing that I want is to include the amount, that has its own
defined name because this will change from month to month. Is there a way
for this macro to copy both references "submitted" and another one called
"feb" into the same worksheet?

Dominique






All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com