Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Help needed on Macro

Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that would run
a macro which will unprotect the both the columns, enter the current time in
the Selected cell, and protect both the columns again. same at the time of
End Time.

now I want the macro to enter the date only in the selected cell. but it
should unprotect and Protect both, entire columns. Also, when the columns
are protected, the user should be able to select the cells. please help.

Thanks.
Gary


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Help needed on Macro

Not sure exactly what you are trying to do, but here are some things to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that would run
a macro which will unprotect the both the columns, enter the current time in
the Selected cell, and protect both the columns again. same at the time of
End Time.

now I want the macro to enter the date only in the selected cell. but it
should unprotect and Protect both, entire columns. Also, when the columns
are protected, the user should be able to select the cells. please help.

Thanks.
Gary


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Help needed on Macro

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
oups.com...
Not sure exactly what you are trying to do, but here are some things to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that would
run
a macro which will unprotect the both the columns, enter the current time
in
the Selected cell, and protect both the columns again. same at the time
of
End Time.

now I want the macro to enter the date only in the selected cell. but it
should unprotect and Protect both, entire columns. Also, when the columns
are protected, the user should be able to select the cells. please help.

Thanks.
Gary




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Help needed on Macro

Gary

Assign this macro to a button or a shortcut key combo.

Sub Enter_Date()
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
End Sub

Note.....you set up the protection parameters like which columns are locked and
which cells can be selected in the ToolsProtectionProtect sheet dialog.

Enter a password which you will exchange with "justme" in the code above.


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 13:56:58 -0600, "Gary" wrote:

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
roups.com...
Not sure exactly what you are trying to do, but here are some things to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that would
run
a macro which will unprotect the both the columns, enter the current time
in
the Selected cell, and protect both the columns again. same at the time
of
End Time.

now I want the macro to enter the date only in the selected cell. but it
should unprotect and Protect both, entire columns. Also, when the columns
are protected, the user should be able to select the cells. please help.

Thanks.
Gary




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Help needed on Macro

Thanks a ton. How do i protect the code?


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Gary

Assign this macro to a button or a shortcut key combo.

Sub Enter_Date()
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
End Sub

Note.....you set up the protection parameters like which columns are
locked and
which cells can be selected in the ToolsProtectionProtect sheet dialog.

Enter a password which you will exchange with "justme" in the code above.


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 13:56:58 -0600, "Gary" wrote:

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
groups.com...
Not sure exactly what you are trying to do, but here are some things to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that
would
run
a macro which will unprotect the both the columns, enter the current
time
in
the Selected cell, and protect both the columns again. same at the time
of
End Time.

now I want the macro to enter the date only in the selected cell. but
it
should unprotect and Protect both, entire columns. Also, when the
columns
are protected, the user should be able to select the cells. please
help.

Thanks.
Gary







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Help needed on Macro

Oh i got the protection part. Now i have another problem. sorry for being
such a pain.

Is it possible that once the time is entered in that cell, if we press the
button again, it doesnt change?

something like. If the active cell is blank only then run the macro else
give an error message like "You've already entered the time"

Thanks a tonnn for ur help.

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Gary

Assign this macro to a button or a shortcut key combo.

Sub Enter_Date()
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
End Sub

Note.....you set up the protection parameters like which columns are
locked and
which cells can be selected in the ToolsProtectionProtect sheet dialog.

Enter a password which you will exchange with "justme" in the code above.


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 13:56:58 -0600, "Gary" wrote:

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
groups.com...
Not sure exactly what you are trying to do, but here are some things to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that
would
run
a macro which will unprotect the both the columns, enter the current
time
in
the Selected cell, and protect both the columns again. same at the time
of
End Time.

now I want the macro to enter the date only in the selected cell. but
it
should unprotect and Protect both, entire columns. Also, when the
columns
are protected, the user should be able to select the cells. please
help.

Thanks.
Gary





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Help needed on Macro

Sub Enter_Date()
If ActiveCell.Value = "" Then
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
Else: MsgBox "You have entered the time already"
End If
End Sub


Gord

On Tue, 5 Sep 2006 15:24:27 -0600, "Gary" wrote:

Oh i got the protection part. Now i have another problem. sorry for being
such a pain.

Is it possible that once the time is entered in that cell, if we press the
button again, it doesnt change?

something like. If the active cell is blank only then run the macro else
give an error message like "You've already entered the time"

Thanks a tonnn for ur help.

"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Gary

Assign this macro to a button or a shortcut key combo.

Sub Enter_Date()
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
End Sub

Note.....you set up the protection parameters like which columns are
locked and
which cells can be selected in the ToolsProtectionProtect sheet dialog.

Enter a password which you will exchange with "justme" in the code above.


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 13:56:58 -0600, "Gary" wrote:

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
egroups.com...
Not sure exactly what you are trying to do, but here are some things to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that
would
run
a macro which will unprotect the both the columns, enter the current
time
in
the Selected cell, and protect both the columns again. same at the time
of
End Time.

now I want the macro to enter the date only in the selected cell. but
it
should unprotect and Protect both, entire columns. Also, when the
columns
are protected, the user should be able to select the cells. please
help.

Thanks.
Gary





Gord Dibben MS Excel MVP
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Help needed on Macro

Thanks a ton Gord. You Rock.


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Sub Enter_Date()
If ActiveCell.Value = "" Then
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
Else: MsgBox "You have entered the time already"
End If
End Sub


Gord

On Tue, 5 Sep 2006 15:24:27 -0600, "Gary" wrote:

Oh i got the protection part. Now i have another problem. sorry for being
such a pain.

Is it possible that once the time is entered in that cell, if we press the
button again, it doesnt change?

something like. If the active cell is blank only then run the macro else
give an error message like "You've already entered the time"

Thanks a tonnn for ur help.

"Gord Dibben" <gorddibbATshawDOTca wrote in message
. ..
Gary

Assign this macro to a button or a shortcut key combo.

Sub Enter_Date()
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
End Sub

Note.....you set up the protection parameters like which columns are
locked and
which cells can be selected in the ToolsProtectionProtect sheet
dialog.

Enter a password which you will exchange with "justme" in the code
above.


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 13:56:58 -0600, "Gary" wrote:

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
legroups.com...
Not sure exactly what you are trying to do, but here are some things
to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that
would
run
a macro which will unprotect the both the columns, enter the current
time
in
the Selected cell, and protect both the columns again. same at the
time
of
End Time.

now I want the macro to enter the date only in the selected cell. but
it
should unprotect and Protect both, entire columns. Also, when the
columns
are protected, the user should be able to select the cells. please
help.

Thanks.
Gary





Gord Dibben MS Excel MVP



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Help needed on Macro

Thanks for the feedback.

Gord

On Wed, 6 Sep 2006 08:18:42 -0600, "Gary" wrote:

Thanks a ton Gord. You Rock.


"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Sub Enter_Date()
If ActiveCell.Value = "" Then
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
Else: MsgBox "You have entered the time already"
End If
End Sub


Gord

On Tue, 5 Sep 2006 15:24:27 -0600, "Gary" wrote:

Oh i got the protection part. Now i have another problem. sorry for being
such a pain.

Is it possible that once the time is entered in that cell, if we press the
button again, it doesnt change?

something like. If the active cell is blank only then run the macro else
give an error message like "You've already entered the time"

Thanks a tonnn for ur help.

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Gary

Assign this macro to a button or a shortcut key combo.

Sub Enter_Date()
ActiveSheet.Unprotect Password:="justme"
ActiveCell.Value = TimeValue(Now)
ActiveSheet.Protect Password:="justme"
End Sub

Note.....you set up the protection parameters like which columns are
locked and
which cells can be selected in the ToolsProtectionProtect sheet
dialog.

Enter a password which you will exchange with "justme" in the code
above.


Gord Dibben MS Excel MVP

On Tue, 5 Sep 2006 13:56:58 -0600, "Gary" wrote:

Thanks sandy, this is exactly what am trying to do

The macro would...

1. Unprotect the sheet
2. Enter current time in the active cell.
3. Protect the sheet.

can u please send me the exact code. I dont know coding much.

Thanks again.

wrote in message
glegroups.com...
Not sure exactly what you are trying to do, but here are some things
to
start you off:

**Enter in the Current Time into active cell

ActiveCell.Value = TimeValue(Now)

**Protect and unprotect a Sheet

ActiveSheet.Protect Password:="your password goes here(inside the
quotes)"

ActiveSheet.Unprotect "your password goes here(inside the quotes)"


Sandy



Gary wrote:
Hi,

Heres what am trying to accomplish.

two columns (protected), column A - Start Time and Column B End Time.

now when a person starts working he needs to enter the current time
in...say... A1. I want that person to press a key combination that
would
run
a macro which will unprotect the both the columns, enter the current
time
in
the Selected cell, and protect both the columns again. same at the
time
of
End Time.

now I want the macro to enter the date only in the selected cell. but
it
should unprotect and Protect both, entire columns. Also, when the
columns
are protected, the user should be able to select the cells. please
help.

Thanks.
Gary





Gord Dibben MS Excel MVP



Gord Dibben MS Excel MVP
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
link to combobox legepe Excel Discussion (Misc queries) 4 July 26th 06 04:45 PM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
HELP NEEDED FOR IF Function Inside a Macro Sandi Excel Worksheet Functions 1 June 2nd 06 04:14 AM
Macro Help needed tamato43 Excel Discussion (Misc queries) 1 August 19th 05 01:48 AM


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"