How can I suppress the dialog box that warns the user that a worksheet will be permanently deleted? I'm just deleting a temporary worksheet that I used during my code like this:
Dim Wks as Worksheet
Set Wks = Worksheets.Add( _
After:=Worksheets(Worksheets.Count), _
Type:=xlWorksheet)...
I am currently keeping a database-like workbook that, when changed by a network user, will update an internal website with an image of one of its charts. Here's where things get tricky: the website was scripted by someone else and lacks any flexibility with its images. In order to make the...
Use this before doing anything that will change the graphical structure of anything in the workbook:
Application.ScreenUpdating = False
This line will freeze the screen from refreshing the updates to the workbook that your script performs. In general, it is not necessary to turn the...
I'm interested in writing code in which I can use the name I've given to a particular object inside the VBAProject window. For instance, when looking at the Properties of a chart in the VBA Editor | VBAProject Explorer, one sees many options, one of which is called "(Name)".
Does...
I'm receiving a date in three parts (month,day,year) from a userform. Is there a prescripted VBA function that can check to see if this is a valid date? I have been using
dtDate = CDate(DateSerial(iYear,iDay,iMonth))
bValidDate = IsDate(dtDate)
to make this decision, but DateSerial will...
I hate to ask these kind of questions, but... why doesn't this work? I'm getting a compile error on the Set dtFindMe line.
Sub FindDate()
Dim dtFindMe As Date
Dim rgFoundMe As Range
Set dtFindMe = DateSerial(2002, 2, 22)
Set rgFoundMe = Range("A:A").Find(what:=dtFindMe)...
The data is automatically taken from the sheet by the macro. Whilst taking the data from the worksheet, I'm attempting to also find out the name of the worksheet that it's coming from.
What I was really looking for was to be able to get the tab name of the worksheet. Here's a snippet:
ActiveChart.SeriesCollection(1).Name = ???
Where "???" is the name of the worksheet tab that the data was pulled from. ActiveSheet.Name won't work because the activated sheet is...
I'm working on scripting an small VBA project for Excel2000 that will graph preknown data points from a dynamic amount of data sheets. Since the data sheets will be entered by the end-user in an unknown order, the code must retrieve the name of the worksheet for use as a title for the data in...