Request All _ Need big help in to built logic built

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
Hi Im still wondering with lot many problem's..

Request all board members pls look at this and try to provide me solution..

I really dont understand how to start..

I will start from below...
There are 2 sheet's which I dont want to show to user's..
Code:
Private Sub Worksheet_Activate()
Dim Pass As String


Application.Goto Me.UsedRange.SpecialCells(xlCellTypeLastCell).Offset(2, 2), True
Pass = Application.InputBox("Please enter password.")


If Pass = "WTW" Then
    Sheets("Sheet1").Visible = True
End If
End Sub

Code:
Private Sub Worksheet_Activate()
Dim Pass As String
Application.Goto Me.UsedRange.SpecialCells(xlCellTypeLastCell).Offset(2, 2), True
Pass = Application.InputBox("Please enter password.")
If Pass = "WTW" Then
    Sheets("Sheet1").Visible = True
End If
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
On User Form I have code below..
Code:
Private Sub UserForm_Initialize()
UserForm.BackColor = RGB(200, 215, 223)


Dim Uname As String
Uname = Application.UserName
Me.LblUname = Uname


If SheetExists(Application.UserName) Then
Else
Worksheets.Add After:=Sheets(Sheets.Count)
    With Sheets(Sheets.Count)
       .Visible = True
       .Name = Application.UserName
       .Visible = False
    End With
End If
End Sub


Function "SheetExists"..
Code:
Function SheetExists(sheetName As String, Optional Wb As Workbook) As Boolean
    If Wb Is Nothing Then Set Wb = ThisWorkbook
    On Error Resume Next
    SheetExists = (LCase(Wb.Sheets(sheetName).Name) = LCase(sheetName))
    On Error GoTo 0
End Function
[CODE]




This code is on Submit Button
[CODE]
Private Sub btnsubmit_Click()
Dim sht As Worksheet, NewSh As String, ShName As String
Dim Closed_date As Date, newrow As Long


Application.ScreenUpdating = False


If cmbActivity.ListIndex = -1 Then
    MsgBox ("Select Activity Type")
    Exit Sub


Else


If cmbActivity.Enabled = True Then
    
    If ComboBox1.ListIndex = -1 Then
        If cmbActivity.Value = "Core" Then
            MsgBox ("Select sub Core Activity")
        End If
        If cmbActivity.Value = "Non-Core" Then
            MsgBox ("Select sub Non - Core Activity")
        End If
    
    Else
    
    'Start Non-Core here..
    If cmbActivity.Value = "Non-Core" Then
    
        Sheets(Me.LblUname.Caption).Visible = True
        Sheets(Me.LblUname.Caption).Select
        
        NewSh = ActiveSheet.Name
        
        With Sheets("Sheet1")
            .Unprotect pWord
            .Visible = True
        End With
        
        Sheets("Sheet1").Select
        Rows("1:1").Copy
        Sheets(NewSh).Activate
        Range("A1").PasteSpecial xlPasteValues
        Range("A1").PasteSpecial xlPasteFormats
        
        Set sht = Application.Workbooks("Timesheet.xlsm").Sheets(NewSh)
        newrow = sht.Cells(Rows.Count, 1).End(xlUp).Row + 1
        sht.Cells(newrow, 1) = CDate(Me.txtstartdate)
        Closed_date = DateTime.Now
        sht.Cells(newrow, 2) = CDate(Closed_date)
        '---------------------------------------------
        sht.Cells(newrow, 3) = Me.cmbActivity   'Col C
        sht.Cells(newrow, 4) = Me.ComboBox1     'sub Type Col D
        sht.Cells(newrow, 5) = Me.TxtCaseID     'Col E
        sht.Cells(newrow, 6) = Me.TxtEETime     'Col F
        '---------------------------------------------
        sht.Cells(newrow, 7) = Me.cmbClientName  'Col G
        sht.Cells(newrow, 8) = Me.cmbTaskName    'Col H
        sht.Cells(newrow, 9) = Me.TextBox1       'Col I
        sht.Cells(newrow, 10) = Me.cmbTaskStatus 'Col J
        sht.Cells(newrow, 11) = Me.txtcomm       'Col K
        sht.Cells(newrow, 12) = Me.LblUname      'Col L
        Workbooks("Timesheet.xlsm").Save
        MsgBox "Details Updated"
 
Last edited:
Upvote 0
Problem is, i have placed code on "Worksheet_Activate" and therefore in main code whenever i try to open Sheet1 im facing problem in passing password in input msg box
 
Upvote 0
dear Rick rothstain sir, Fluff sir, Vog sir, MIchel M sir, Shg sir, Ranman sir, Joe4 sir, Logit, Rorya Sir
....Some one please help in solve this...:help:
 
Upvote 0
This timesheet tracker working properly, when i kept this in not sharing mode.
But i need to work this excel workbook in sharing mode.

In sharing mode, protect worksheet as welll as protect workbook gets disabled and hence it gives error that "Unprotect" not working on user form like this..

Can anyone please provide some other solution...

Or,

In single folder different workbooks will create with user names and data saves..anything like this..
 
Upvote 0
I suggest that you look at the second paragraph of #12 of the Forum Rules. Your thread now has > 5 posts - many readers will just pass over it thinking it is under control or they don't want to get involved in a thread that has several other posters. (You have also been given advice before about bumping your threads too quickly & too often)


dear Rick rothstain sir, Fluff sir, Vog sir, MIchel M sir, Shg sir, Ranman sir, Joe4 sir, Logit, Rorya Sir
....Some one please help in solve this...:help:
I suggest that you also note 5.g. of the Forum Use Guidelines

Perhaps 5.h. may also be relevant to you as you seem to be in a great hurry.
 
Last edited:
Upvote 0
Big Apologies Sir..I agree totally. I'm totally lost, b'coz of no idea about coding. I know it's pretty simple solution, but im not that much technical good in vba code. Hence it goes from me..
But believe me, its pretty simple requirement I have..
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top