PDA

View Full Version : Solved: Selection of worksheet



Jaypee
11-11-2007, 11:52 AM
When adding a new entry (from a userform), I also create a new sheet linked to that spesific client. What I would like to achieve is to when I select that entry (in the listbox) it must select (activate) the corresponding sheet.

I have tried some examples, but I could not get it to work in my scenario

I use the basic sheet names and the sheetname is contained in column J

Any help would be appreciated

:dunno
Jaypee

XLGibbs
11-11-2007, 12:02 PM
What have you tried?

Unfortunately, without any of your object (sheet, form , listbox) names, we can't answer your question. If the sheetname is in column J (is that on every sheet, or is it on column J of another sheet somewhere?)

Jaypee
11-11-2007, 12:08 PM
I use sheet1 for the client data and for every new client added I create a new sheet where his info is kept.

On sheet1 column J is where the reference to that sheet is kept.

Hope this helps, else I'll add my file as well

Thanks for your reply.

Bob Phillips
11-11-2007, 12:08 PM
Maybe something like



Worksheets(ListBox1.Value).Select


but I fail to see what benefit you get from selecting it.

Jaypee
11-11-2007, 01:05 PM
Thanks this works just fine. What I am trying to accomplish is to use sheet1 as a register of clients and any data entered to a client must be done on his own sheet. Now when I select a client in the list box the corresponding sheet that contains all the data must be selected and then also when I would delete the record, the sheet must be deleted as well.

Thanks for your help again.

Norie
11-11-2007, 01:44 PM
As xld has indicated there shouldn't be any need to select/activate worksheets.

mikerickson
11-11-2007, 02:44 PM
ThisWorkbook.Sheets("Sheet1").Range("a1").Value = "test"
is the syntax for entering "test" into Sheet1!A1 without selecting either the sheet or the cell.