Re: Insert Variable Graphic
Just create a table that lists the cell values possible and the graphic it would then take and program from there. Easy enough!
Re: Insert Variable Graphic
Just create a table that lists the cell values possible and the graphic it would then take and program from there. Easy enough!
Re: Format Userform Labels
The one mentioned above
Re: Format Userform Labels
I found a different method for my desired results that involves a bunch of logic but I would still like to see if there is a built in method for the label object. Here's an example of the code you gave me and that I get the error from:
Private Sub UserForm_Activate()
Me.lbHSing.Caption = Format$(Sheet9.Range("D72").Value, "0.00")
end sub
I'm using labels to show rates which we want in currency format for our customers. Here's my work around if anyone's interested and then it will give you a better idea of what results I am looking for:
If Sheet9.Range("D72").Value - Int(Sheet9.Range("D72").Value) = 0 Then
Me.lbHSing.Caption = "$" & Sheet9.Range("D72").Value & ".00"
ElseIf Left(Right(Sheet9.Range("D72").Value, 3), 1) <> "." Then
Me.lbHSing.Caption = "$" & Sheet9.Range("D72").Value & "0"
Else: Me.lbHSing.Caption = "$" & Sheet9.Range("D72").Value
End If
thanks for the interest
Re: Format Userform Labels
I get this error when trying to run the userform with that code: "Type-declaration character does not match data type"
Is there a method for formating numbers in a label on a userform?
Re: Set Label Control Captions to a Cell Text/Value
And how or where do I do that?
Re: Alt + PageUp not working
Sorry I meant Ctrl + PageUp to scoll the sheets.
I have a worksheet that veryhides all the sheets but one when closes and when opens if unhides the ones a user needs. For some reason the quick key Alt + PageUp or Alt + PageDown doesn't work until each sheet is scrolled through by clicking on their tab with the mouse. Any thoughts anyone?
Hi everyone,
I have a Excel 2003 application I am developing. It has two user sides one for our pricing department and the other for the marketing department. I have built it so marketing has limited access to the workbook so as not corrupt the data.
The way this works is that when the workbook is closed all but one sheet is veryhidden. When a user reopens it and signs in the sheets they use are then visible. But they are also given a user form to fill in but when they hit the command button to enter data on the sheets I get "Select method of range class failed" msg.
Here's the code for closing the workbook:
Private Sub Workbook_Beforeclose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Not ws.Name = "Login" Then ws.Visible = xlSheetVeryHidden
Next ws
End Sub
Here's the code for unhiding the sheets:
Function UnhideSheets()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Sheets("Drop Down New").Visible = xlHidden
Sheets("Trend by Index").Visible = xlHidden
Sheets("Log Sheet").Visible = xlHidden
Sheet12.Range("A1").Select
Application.ScreenUpdating = True
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect
Next ws
End Function
Display More
What do I need to add to make the selection method work again?
Thanks
Re: Set Label Control Captions to a Cell Text/Value
Nice...That works perfectly. Thanks
Re: Run-Time error '424': Object required
They way it ran looked like the error occured in that code.
I have an excel application that I'm developing that is going to be used by two different departments. On one side everything will pretty much be userforms. The sheets they the data I need to pull in for them is on sheets that I have such that their visibilty is equal too xlveryhidden.
I'm trying to change the captions on labels using the data on the veryhidden sheets. Something like this.
'frmCurrentProposal is a userform
'lbGroupName and lbGroupNum are both labels that should vary
frmCurrentProposal.Show
frmCurrentProposal.lbGroupName.Caption = Sheet2.Range("B2").Value
frmCurrentProposal.lbGroupNum.Caption = "Group # " & Sheet2.Range("B3").Value
The labels are not changing their values.
I hope this makes sense.
Re: Run-Time error '424': Object required
Dave you got me thinking about how I project is connected and I was able to find the solution.
The previous code posted was for a command button on the userform. The error was actually here:
Private Sub Workbook_Open()
If Sheet2.Range("B11").Value = "Albany R1" Or Sheet2.Range("B11").Value = "Albany R2" Then
frmUserLoginAlb.Show
txtUserNameAlb.SetFocus 'caused the error
Else
frmUserLogin.Show
txtUserName.SetFocus 'caused the error
End If
End Sub
Display More
Here is the fix:
Private Sub Workbook_Open()
If Sheet2.Range("B11").Value = "Albany R1" Or Sheet2.Range("B11").Value = "Albany R2" Then
frmUserLoginAlb.Show
frmUserLoginAlb.txtUserNameAlb.SetFocus
Else
frmUserLogin.Show
frmUserLogin.txtUserName.SetFocus
End If
End Sub
Display More
Thanks for everyone's input.
Re: Run-Time error '424': Object required
Those are both not true.
Re: Run-Time error '424': Object required
I don't want it to close if not a new project. If it is a new project then they are just prompted to enter general data and gives me control of how and where the data is stored so other macros in the workbook work properly. The form that I am unloading is a userform that they enter their username and password and then choose what department access they are entering. So I am unloading a form called frmUserLogin.
I have an Excel workbook that I have built in user-level security to log into. If login is successful I have code like this:
If 'successful conditions
Goto Success
'more code here that doesn't matter
Success:
'verfies that it is a new project
lgCreateProject = MsgBox("Would you like to create a new project?", vbYesNo)
'opens a userform if new project
If lgCreateProject = vbYes Then frmQuoteInfo.Show
Unload Me
End sub
Display More
If the user signs on successfully and is not starting a new project then they get the error noted in the title of my thread.
Thanks for the help.
Re: Empty looking cells not empty
Thanks Derk. If I have my VBA test for " " then it recognizes these cells. That is 2 blanks.
Re: Empty looking cells not empty
Len is returning 2 on my empty looking cells.
I have a recordset that I get from Access and dump it onto an Excel spreadsheet. Many cells look empty but when I run a macro that depends on if these cells are empty it considers them not to be empty. Does anyone know what Access is putting in these empty cells?
I have a large workbook with cells that simple pull values from other worksheets within the workbook. It has been discovered that when the referenced cell is changed the dependent cell remains the same. It is set to Auto calculate. Does anyone know why this may be? Thanks ahead of time.