sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
I'd like a piece of code that can create a button that perfectly covers cell A1 and then runs the following piece of code for only that row, not every row as the code was originally designed. Thank you for your help. Also, and the important part, it has to check if there are contents in column I of that row (so starting in on row 4, make a button that covers A4 if there are contents in Cell I4, and then that button will run the code below but for only that row, not every row. thanks again!
I will be placing this in the "thisworkbook" piece to run as soon as the workbook opens such that every time the workbook opens, excel will be making these buttons based on what
"i" cells are populated.
I will be placing this in the "thisworkbook" piece to run as soon as the workbook opens such that every time the workbook opens, excel will be making these buttons based on what
"i" cells are populated.
Code:
Sub DemoTestDate()'First time initializing Code
Dim s As String
Dim name As String
Dim resp As Integer
Dim bdate As String
Dim ddate As String
name = Sheets("Notes").Range("N4")
bdate = Sheets("Developer").Range("A36")
ddate = Sheets("Developer").Range("C34")
s = GetSetting("DemoTest", "Registration", "Username")
If s = "" Then
Sheets("Developer").Unprotect Password:=Worksheets("Developer").Range("B15:E15").Value
Sheets("Developer").Range("B34:F34").ClearContents
's = InputBox("Welcome to the " & namer & " Voyage Reporting System." & vbCrLf & "Please input the appropriate name to initialize the system for the first time." & vbCrLf & vbCrLf & "Note: this information can be modified later by clicking on the [Developer] button.", namer, "Bridge")
'UserForm17.Show
s = cInputBox()
MsgBox s
If s <> "" Then
's = cInputBox()
Sheets("Developer").Unprotect Password:=Worksheets("Developer").Range("B15:E15").Value
Sheets("Developer").Range("B34") = s
SaveSetting "DemoTest", "Registration", "Username", s
Sheets("Notes").Visible = xlSheetVisible
Sheets("Notes").Select
Sheets("Developer").Range("C36") = Date
'If s <> "" Then MsgBox "Welcome to the " & name & " Voyage Reporting System." & vbCrLf & "Please input the appropriate data to initialize the system for the first time." & vbCrLf & vbCrLf & "Note: this information can be modified later by clicking on the [Developer] button.", vbOKOnly, name
Application.Visible = True
Sheets("Developer").Protect Password:=Worksheets("Developer").Range("B15:E15").Value
End If
End If
End Sub