ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   save as command in macro (https://www.excelbanter.com/excel-programming/424410-save-command-macro.html)

exploringmacro

save as command in macro
 
Hi. Can someone help me please. I have two things that some help.

1. I've created workbook with multiple sheets, i made changes to one of the
sheet and i want to save that worksheet into new excel file. I've created a
macro but its not working.

2. I've created workbook with multiple sheets, eg, Sheet2 and Sheet 3. I
have a checklist template on Sheet 2 (see below), and on Sheet3, I need to
get the value from SHEET2 where FINDINGS=N (please see below), on SHEET 3 I
need the valud of CODE, DESCRIPTION and REMARKS

EG. SHEET2 (CHECKLIST)

CODE DESCRIPTION FINDINGS REMARKS
W32 STAIN N
STAIN ON FLOOR
W33 WALL PAINT Y

W34 TIMBER N
TIMBER DOOR

EG. SHEET3 (REPORT)

CODE DESCRIPTION REMARKS
W32 STAIN STAIN IN FLOOR
W34 TIMBER TIMBER DOOR

Appreciate your help.

thanks

Stefi

save as command in macro
 
1. Post the macro!
2.
Sub test()
Columns("C:C").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="N"
Selection.CurrentRegion.Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy Destination:=Worksheets("Munka2").Range("A1")
End Sub

Regards,
Stefi



€žexploringmacro€ť ezt Ă*rta:

Hi. Can someone help me please. I have two things that some help.

1. I've created workbook with multiple sheets, i made changes to one of the
sheet and i want to save that worksheet into new excel file. I've created a
macro but its not working.

2. I've created workbook with multiple sheets, eg, Sheet2 and Sheet 3. I
have a checklist template on Sheet 2 (see below), and on Sheet3, I need to
get the value from SHEET2 where FINDINGS=N (please see below), on SHEET 3 I
need the valud of CODE, DESCRIPTION and REMARKS

EG. SHEET2 (CHECKLIST)

CODE DESCRIPTION FINDINGS REMARKS
W32 STAIN N
STAIN ON FLOOR
W33 WALL PAINT Y

W34 TIMBER N
TIMBER DOOR

EG. SHEET3 (REPORT)

CODE DESCRIPTION REMARKS
W32 STAIN STAIN IN FLOOR
W34 TIMBER TIMBER DOOR

Appreciate your help.

thanks


Dave Peterson

save as command in macro
 
#1.

Option Explicit
Sub testme()
Dim wks As Worksheet

Set wks = ActiveSheet 'or worksheets("Somesheetnamehere")
wks.Copy 'to a new workbook

With ActiveSheet
'just overwrite the .xls file, don't give me a warning
Application.DisplayAlerts = False
.Parent.SaveAs _
Filename:="C:\" & Format(Now, "yyyymmdd_hhmmss") & ".xls", _
FileFormat:=xlworkbooknormal
Application.DisplayAlerts = True
.Parent.Close savechanges:=False
End With

End Sub

exploringmacro wrote:

Hi. Can someone help me please. I have two things that some help.

1. I've created workbook with multiple sheets, i made changes to one of the
sheet and i want to save that worksheet into new excel file. I've created a
macro but its not working.

2. I've created workbook with multiple sheets, eg, Sheet2 and Sheet 3. I
have a checklist template on Sheet 2 (see below), and on Sheet3, I need to
get the value from SHEET2 where FINDINGS=N (please see below), on SHEET 3 I
need the valud of CODE, DESCRIPTION and REMARKS

EG. SHEET2 (CHECKLIST)

CODE DESCRIPTION FINDINGS REMARKS
W32 STAIN N
STAIN ON FLOOR
W33 WALL PAINT Y

W34 TIMBER N
TIMBER DOOR

EG. SHEET3 (REPORT)

CODE DESCRIPTION REMARKS
W32 STAIN STAIN IN FLOOR
W34 TIMBER TIMBER DOOR

Appreciate your help.

thanks


--

Dave Peterson


All times are GMT +1. The time now is 08:03 AM.

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