ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   creating a macro where the values entered in a text box on a user (https://www.excelbanter.com/excel-programming/373427-creating-macro-where-values-entered-text-box-user.html)

BrianMo

creating a macro where the values entered in a text box on a user
 
Hello,
I have a question about a specific macro that I am trying to create. In
this macro I want to have it so when a user enters in their first and last
name in the two text boxes on my user form and click the command button
titled login it will then take them to a specific range of cells which are
named after the employee's name.

Which will then be linked to a macro I wrote earlier where a specific cell
is clicked within that range and the rest of the cells on the worksheet not
in that range are locked and protected via password. Here is the code I have
for the first macro. It's very simple but I was going for a basic code here
since this is a mock.


Sheets("Employee Tracker").Select
Range("A25:M25").Locked = False
Range("A25:M25").Select
ActiveSheet.Protect Password:="testpass"
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("C3:C25").Select
Range("C25").Select

Thanks in advance for any help


[email protected]

creating a macro where the values entered in a text box on a user
 
Can you explain that alittle more clearly?

BrianMo wrote:
Hello,
I have a question about a specific macro that I am trying to create. In
this macro I want to have it so when a user enters in their first and last
name in the two text boxes on my user form and click the command button
titled login it will then take them to a specific range of cells which are
named after the employee's name.

Which will then be linked to a macro I wrote earlier where a specific cell
is clicked within that range and the rest of the cells on the worksheet not
in that range are locked and protected via password. Here is the code I have
for the first macro. It's very simple but I was going for a basic code here
since this is a mock.


Sheets("Employee Tracker").Select
Range("A25:M25").Locked = False
Range("A25:M25").Select
ActiveSheet.Protect Password:="testpass"
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("C3:C25").Select
Range("C25").Select

Thanks in advance for any help



BrianMo

creating a macro where the values entered in a text box on a u
 
I have a user form titled User interface with two text boxes one for the
user's first name and one for their last name. After they input their name
for example Brian Monaghan and click on my command button titled login I want
to have a macro that will take them to a range of cells named Brian_Monaghan.
Then I want that same macro to be the case for every employee named entered
who have corresponding ranges named after them as well.

" wrote:

Can you explain that alittle more clearly?

BrianMo wrote:
Hello,
I have a question about a specific macro that I am trying to create. In
this macro I want to have it so when a user enters in their first and last
name in the two text boxes on my user form and click the command button
titled login it will then take them to a specific range of cells which are
named after the employee's name.

Which will then be linked to a macro I wrote earlier where a specific cell
is clicked within that range and the rest of the cells on the worksheet not
in that range are locked and protected via password. Here is the code I have
for the first macro. It's very simple but I was going for a basic code here
since this is a mock.


Sheets("Employee Tracker").Select
Range("A25:M25").Locked = False
Range("A25:M25").Select
ActiveSheet.Protect Password:="testpass"
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("C3:C25").Select
Range("C25").Select

Thanks in advance for any help





All times are GMT +1. The time now is 03:00 AM.

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