Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
Office GroupsView
Excel
Excel Charting
Excel Crashesgpfs
Excel Misc
Excel Newusers
Excel Programming
Excel Setup
Excel Worksheet Functions
Word Application Errors
Word Conversions
Word Customization Menustoolbars
Word Docmanagement
Word Drawing Graphics
Word International Features
Word Mail
Word Mailmerge Fields
Word Newusers
Word Numbering
Word Oleinterop
Word Pagelayout
Word Printingfonts
Word Setup Networking
Word Spelling Grammar
Word Tables
Word Visual Basica Addins
Word Visual Basica Customization
Word Visual Basica General
Word Visual Basica Userforms
Works Win
Office Developer Automation
Office Developer Com Add_Ins
Office Developer Officedev Other
Office Developer Outlook Forms
Office Developer Outlook Visual Basica
Office Developer Visual Basica
Office Misc
Office Setup
Officeupdate
Onenote
Outlook
Outlook Bcm
Outlook Calendaring
Outlook Contacts
Outlook Fax
Outlook General
Outlook Installation
Outlook Interop
Outlook Mac
Outlook Printing
Outlook Program_Addins
Outlook Program_Forms
Outlook Program_Visual Basica
Outlook Teamfolders
Outlook Thirdpartyutil
Project
Project Developer
Project Server
Visio
Visio Developer
Visio General
Word Visual Basica Beginners
Outlookexpress General
Office Communicator
Word Programming
Office Templates Misc

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft Excel Programming Posts  Ask A New Question 

Hi AkashYou can not change any cell which is protected.

Per Jessen posted on Wednesday, January 16, 2008 8:15 AM

Hi Akash

You can not change any cell which is protected.

So you have to unprotect the cell before you can add the date.

Private Sub Worksheet_Change(ByVal Target As Range)
If LastCol = 1 Then
CurRow = ActiveCell.Row
CurCol = ActiveCell.Column
'MsgBox ActiveCell.Row
'MsgBox ActiveCell.Column

'MsgBox Target
With Sheets(Sheet1)

If .Cells(LastRow, 7).Value = "" Then
.Unprotect
.Cells(LastRow, 7).Value = Date
.Cells(LastRow, 4).Select
.Protect
End If
End With
End If
End Sub

Regards,

Per
reply

 

Macro not running in Protect Sheet

Akash posted on Thursday, January 17, 2008 6:37 AM

Hi,

I have a macro, With the help of this macro, as soon as u write
anything in Column A it would automatically  throws a Current Date in
Column G:


Dim LastRow, LastCol, CurRow, CurCol As Integer

Private Sub Worksheet_Change(ByVal Target As Range)
If LastCol = 1 Then
CurRow = ActiveCell.Row
CurCol = ActiveCell.Column
'MsgBox ActiveCell.Row
'MsgBox ActiveCell.Column

'MsgBox Target

If Sheet1.Cells(LastRow, 7).Value = "" Then
Sheet1.Cells(LastRow, 7).Value = Date
Cells(LastRow, 4).Select
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
LastRow = ActiveCell.Row
LastCol = ActiveCell.Column
'MsgBox ActiveCell.Row
'MsgBox ActiveCell.Column

End Sub


There are other formulas in the Excel Sheet. I had protected the sheet
to hide the formula. but as soon as i protected the sheet, my macro is
not working.


Can u help me how can i run the macro even after i protect the sheet.

Is there any way.

Thanks

Akash
reply