![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 24
|
HI, I have just started using excel after becominreasonable profficient in Access.
Eeeeek, there are no do it your self cut and paste macros! Ouch! Here is what I need. I need to know how to clear a row in a table from a for in another worksheet. This worksheet contains textboxes and drop down menus which link to tables in other worksheets. I want to put a command button on the main form whcih will clear all the contents of these text boxes and the cells they link to. It would be ideal that a refresh - clear contents fromm these rows acts on iniciation of the workbook. Also, I would like to open different worksheets from command buttons on the main form. Sorry. Am I asking too much? I am just starting out Thanks Mathew |
|
|
|
|
|
#2 | |||
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
TextBox1.Text = "" will clear the contents of your text box. If the text box is linked to a cell, it should automatically clear out that cell as well. Of course, you could also clear the cell using: Range("A1").ClearContents Quote:
Private Sub Workbook_Open() Sheets("Sheet1").Rows("2:3").ClearContents End Sub and change the sheet and row references to your requirements. Quote:
Private Sub CommandButton1_Click() Workbooks.Open FileName:= _ "C:Book1.xls" End Sub If you need any further help just let me know. Regards,
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|||
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 24
|
Also, I would like to open different worksheets from command buttons on the main form.
-------------------------------------------------------------------------------- Thank you very much. Everything works apart from: the last part I want to open different worksheets in the same workbook from command buttons on sheet one - not open workbooks. This part Attach code to your button that resembles this: Private Sub CommandButton1_Click() Workbooks.Open FileName:= _ "C:Book1.xls" End Sub PLease help. Mathew |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
This will activate Sheet3. Is this what you are looking for?
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Posts: 24
|
Yes, exactly!
Thank you |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|