Autoexecute macro

  • Thread starter Thread starter Joanne M.
  • Start date Start date
J

Joanne M.

What I need it this,

As soon as a user opens a specific file, the macro ( in vba), creates
another worksheet, inserts 3 columns and makes the first column auto
numbered. I am sure this isn't hard. But I am a "newbie" to this.

Can anyone help me?

Joanne
 
Hi, use the macro recorder to created actions you require, then copy
and paste the macro in the workbook open event



this site

http://contextures.com/xlvba01.html

will show you where the modules are located


eventually it will be in a spot like this

Private Sub Workbook_Open()
'your code here
End Sub
 
Joanne,

Auto running a macro is achieved by using the Workbook_Open macro so you
could use:-

Private Sub Workbook_Open()
Worksheets.Add
End Sub

There's no point in adding any columns because the sheet already has as many
as is allowed.

With regard to the last bit I think you need to clarify what you mean
because numbering all column A would take a fair while and you would only end
up with duplicate row numbers.

Mike
 
Back
Top