Maxcro questions

T

Tino

Some macro questions.

1 With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "P2-HCZ"
End With

The above code will label the chart title. Is there any way of using the
contents of a cell for the chart label rather than specific text, eg replace
"P2-HCZ" with a cell reference, A1, for example?




2 ActiveWorkbook.SaveAs Filename:= _
"HCZ_radiometrics.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

The above code will save the current workbook as
"HCZ_radiometrics.xls". If "HCZ_radiometrics.xls" already exists then a
dialog box pops up and asks to confirm the SaveAs. Is there anyway of
automatically overwriting existing files, ie no confirmation required?



3 Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete

The above code will delete the selected sheet ("Sheet1"). Before
deleting, a dialogue box asks to confirm the delete. Is there anyway of
deleting the sheet without asking for confirmation?


regards

Peter
 
A

aidan.heritage

(1) .ChartTitle.Characters.Text = range("A1").text
(2) Application.DisplayAlerts = False
(but make sure that you include a Application.DisplayAlerts = TRUE
statement before the macro finishes as this is a non volatile setting!)
(3) see 2!
 
T

Tino

Thanks!!!


(1) .ChartTitle.Characters.Text = range("A1").text
(2) Application.DisplayAlerts = False
(but make sure that you include a Application.DisplayAlerts = TRUE
statement before the macro finishes as this is a non volatile setting!)
(3) see 2!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top