ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto deleting records form more than one sheet in a workbook. (https://www.excelbanter.com/excel-programming/377644-auto-deleting-records-form-more-than-one-sheet-workbook.html)

Sam

auto deleting records form more than one sheet in a workbook.
 
I am trying to set up a program to delete a record from one sheet and the
macro goes to the other sheets with the same record and deletes them
automatickly.
I also want to bring up the file to a specific sheet when it is first opened.

Tom Ogilvy

auto deleting records form more than one sheet in a workbook.
 
For the second, look at the workbook_open event. Activate the sheet in
that event.

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"Sam" wrote in message
...
I am trying to set up a program to delete a record from one sheet and the
macro goes to the other sheets with the same record and deletes them
automatickly.
I also want to bring up the file to a specific sheet when it is first
opened.




JLGWhiz

auto deleting records form more than one sheet in a workbook.
 
There are numerous options to for deleting or clearing data and items in VBA.
You can use the help files and search for "Delete Method" as it applies to
the Range Object and "ClearContents Method". It will give you an idea of
what your options are. Then when you are sure of what you want to do. If
you cannot write the code, re-post.

To open to a specific worksheet do the following:

1- Press Alt + F11 to open the Visual Basic Editor.
2- In the project window to the left of your screen click double click on
ThisWorkbook to open the workbook code module.
3- Copy the following code and paste it into the code module that you have
just opened.
Private Sub Workbook_Open()
Worksheets(2).Activate
End Sub
4- Change the number from 2 in parentheses to the worksheet number or name
that you want to appear when you open the file. If you use a name, put it in
quotes.
5- Save the workbook before closing it.

When you reopen the workbook, it will display the worksheet that you
specified.

"Sam" wrote:

I am trying to set up a program to delete a record from one sheet and the
macro goes to the other sheets with the same record and deletes them
automatickly.
I also want to bring up the file to a specific sheet when it is first opened.



All times are GMT +1. The time now is 06:36 PM.

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