When I protect the worksheet with the spinbutton, the spinbutton is no longer accessible. How can I modify the code below (provided by Leith Ross) to make the spinbutton accessible in a protected sheet?
The script it's almost all complete and it'already working. How works this script: From the Combobox_click i load a txt file, the script from the txt file get only the first column of the file. Its a list of numbers.
When this list of code numbers it's loaded in the Combobox_click, for each code number in the image combo box there is a one corrisponding image. For the images folder in the cell J2 the is a one Path reader. the scrip work perfectly.
What i need:
As you can see, under the image combo box, there is a SpinButton. I need that by clicking the Forward or Back button i can go forward or back of the images list.
I have a spinbutton on a userform. Here is the section of code for SpinUp:
[Code]....
Normally, I wouldn't hard code an address in like this, but I was given a last minute project to present on Monday, so it's down,dirty, and quick. Anyways, the adjacent cell "O7" has a formula referencing another page. When I spin the spinner it activates the correct cell (and continues to do so as long as I press the button), but here's the wierdness: cell "07" formula disappears, leaving the existing value in it. It's like it copy pastespecial values.
I've stepped through the code and it's not referencing any other procedure. It happens on this line:
I use spinbuttons to increment 3 data cells (C7:C9). These cells are used as entry data for some calculations and also trigger some macros via change event. Every time I use them the workbook crashes, this is only since I modified one of the instantiated macros that sorts a table on another sheet. See below the spinbutton code with the call of the macro and further the code of the sorting macro:
Private Sub SpinButton1_SpinDown() Range("C7").Value = Range("C7").Value - 0.05 End Sub
Private Sub SpinButton1_SpinUp() Range("C7").Value = Range("C7").Value + 0.05 End Sub
Private Sub SpinButton2_SpinDown() Range("C8").Value = Range("C8").Value - 0.05 End Sub......................................................
I’m using this code to change the value of an active cell with a spinner named: 1.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim lNum As Long If IsNumeric(Target) Then lNum = Target If lNum = Target And Target >= 0 Then With Me.Shapes("1").ControlFormat .LinkedCell = vbNullString .Value = Target .LinkedCell = Target.Address End With Else Me.Shapes("1").ControlFormat.LinkedCell = vbNullString End If End If End Sub
The problem is, that whenever I click or activate a cell its value automatically changes to 0. The spinner works just fine modifying the value of the activated cell. The problem is that this code somehow causes all the decimals such as 0,3 0,1 or 0,8, entered manually, to change to 0. This way only integral numbers, such as 1, 45 or 100 are accepted. I must truly say I have no [no need to swear - mod] idea how to fix these problems meaning the automatically inserted 0 and the fact that the sheet doesn’t accept decimals changing them to an integral number.
I want to be able to link spinbuttons to the cell it is located in automatically, so I can move it around or copy and then paste into other cells. I do not want to use one button to increment a selected cell.
Textbox and SpinButtons, there is code for changing the date in a textbox by using a spinbutton. I have tried to use some variation of that for the purpose of changing time but to no avail. What my intention is, is that if someone enters 12:00 into TextBox that SpinButton_Up or SpinButton_Down can change the time to 12:01... or 11:59... respectively, and so on.
I don't know if title is understandable, English not being my tongue, anyway here's my problem, the current value must be increased or decreased by 0.01 if it's between 1 and 2, by 0.02 between 2 and 3 and so on. I'm really new to VBA and after a few hours I came up with the following code which works fine till the value of 6 and then gets stuck: ....
I'm developing a local timesheet userform application and want to capture times which may be greater than 24hrs using a textbox/spinbutton pairing.
I've managed to pair up and work with times up to 24hrs but the output always resets after 23:55.
I've also tried formatting the output as "[h]:mm" but without success.
Private Sub sbDTime_SpinUp()
With ctrl2 If .Text = vbNullString Then .Text = Format(TimeSerial(0, 5, 0), "hh:mm") Else .Text = Format(TimeValue(.Text) + 5, "hh:mm") End If End With End Sub
Private Sub sbDTime_SpinDown() With ctrl2 If .Text = vbNullString Then .Text = Format(TimeSerial(0, 5, 0), "hh:mm") Else .Text = Format(TimeValue(.Text) + 5, "hh:mm") End If End With End Sub
I'm trying to create a userform to act as a walk-through for a process. I've settled on using a multipage to conserve the required screen real-estate, and break the process into natural 'stages'. I've happily got these stages fixed into the userform's pages, with a couple of command buttons running events OnClick - but cannot figure how to get the spinbutton to navigate between the pages.
I have an Active X SpinButton control directly on a spreadsheet that changes the input cell. (The idea is that later on, there'll be a bunch of these input cells, accompanied by their respective SpinButton controls).
I'm allowing the user to define the Min, Max, and Step (SmallChange) value of the SpinButton because (1) I need it to do decimal points and negative numbers and (2) that's what my boss would have wanted.
So I set the Min, Max, SmallChange value in the SpinButton properties to "0" then try to manipulate them in the VBA code.
What went wrong with the code is hard to explain. But basically, when I use the SpinButton to increment or decrement, it didn't quite do it correctly. If I fix the increment part of code, then the decrement part of the code goes wrong and vice versa.
An example: I have Min as "0.5%" in cell B7; Max as "4.5%" in cell B8; and Step (SmallChange) as "0.5%" in cell B9. The Input cell is in cell B10 where user can either type in a value within the defined range (enforced by data validation) or use the SpinButton to change the value.
To replicate the problem: I type in "1.0" in the Input cell and click on the left SpinButton and it would not allow me to go to the defined lower limit (which is 0.5%) in this case.
Here are my codes:
Private Sub SpinButton1_SpinUp()
Dim MyMax As Variant Dim MyStep As Variant Dim MyInput As Variant
I have a userform with a listbox set to a range of numbers from 1-10, I would like my userform to expand/collapse dependant on the number within the listbox. The problem I am having is the forms height does not adjust from using the toggle controls only when you select back into the listbox itself.
Private Sub ListBox1_Change() If Me.ListBox1.Value = 1 Then Me.Height = 180 End If If Me.ListBox1.Value = 2 Then Me.Height = 210 End If If Me.ListBox1.Value = 3 Then Me.Height = 240 End If End Sub
I have tried using click/after change events however I get the same response. Am I missing something from my code or should I be using another control (SpinButton for instance).
Spreadsheet was created by me and worksheets locked by me with password. Data is maintained by another on the network. Since acquiring a new PC with xl 2003 replacing 2000, none of the worksheets will allow me to unprotect. The "unprotect" menu option is not available (shaded out), and it says "shared" at the top.
I have numerous spreadsheets that work this way, but this is the only one that has this problem. How can I unprotect it to make modifications?
I need a macro code to unprotect all sheets in a book. The sheets may range from 3 to 20 sheets, with a common password. I want to keep this as contol. Only one person will be using this.
I have a workbook that has several macros. When the workbook is saved, it cycles through and kicks off several of them.
This works fine, no errors. I have another macro that saves and then emails the workbook. When this macro runs, the same set of macros is launched due to the save method however it errors during one of the macros.
Basically what's happening is that the one macro (derivecountry) unprotects a sheet and inputs a data value. This macro works fine when run independantly but when it runs as a result of the email macr, the sheet does not get unprotected and the error results.
Here is the code line that runs to unprotect but doesn't always work
I'm working with this workbook and suddenly the worksheets protected! Although I didn't make any password. I checked it but, I coulden't find any password. see code maybe there is a mistake.
I am using the following code to protect/unprotect a sheet in a tool that i am working on, which seems to work great. It unprotects the sheet runs the code inbetween the two liens of code and then protects the sheet again.
The issue I am having is if i want to go in and edit the sheet without running the code it will not let me. When I go in and type the password to unprotect it says it is invalid. I have typed it exactly how the code reads. I have even tried including the quotes but no luck.
It gives me a error and says my password is wrong. I have user names set to return the password so that it is unlocked for certain people. It works for unprotecting the sheets. I modified it and added it back in to try to do it for the workbook.
[Code] .........
I realize that they " and () around the password are differant, but that's how I last left them. I have tried several combinations and it just gives me more errors saying expected end of statement, etc.
I have a spread sheet that is protected. I would like to have cell G5 unprotected when a checkbox is checked. I am able to unprotect the entire sheet by checking the box but I only want G5 unprotected. My current macro that unprotects the entire sheet is
Sub Checkbox_Clear2() Sheets("Input_Personnel").Unprotect ("1") If Range("J12") = False Then Range("G5").ClearContents End Sub
Is there a way to change the highlighted line where it only unprotects cell "G5".
I have a code that is supposed to go through a folder, open the xls file, replace all of the formulas with values only, then save as a xlsx file to get rid of the macros, however when we get into the next workbook it will not unprotect the sheet. instead it unprotects the origional sheet I sweat this worked last week when i was writing the sections and testing but maybe it didnt. The problem is without unprotecting the sheet i can not paste to it
Workbook 1 opens up, find that the date is expired, then goes through the folder and opens a workbook, is then supposed to unprotect the sheets ( this is where the problem comes in) save all the formulas as values and then as XLS in another folder.
I turned the text red in the offending area, everythign up to this point seems to work fine.
Private Sub Workbook_Open() Dim printquotes As String Dim OrigDate As Date letmesave = True OrigDate = ActiveSheet.Range("n2").Value
I have a protected worksheet showing results of users maths tests. When users try to add data to this worksheet, a Windows Office window appears, advising it is a protected sheet, then gives instructions on how to Unprotect it.
I do not want users unprotecting this particular worksheet.
I have a worksheet where the users need to enter time. I have a macro that captures the time when the user hits Ctrl + t
What I want now is a code which protects the cell after entering the time with Ctrl + t.
I tried to do it, but my macro only works when I don't set any passwords to protect the sheet. How can I pass the password to the code and protect the sheet after the code to capture the time is being executed.
I am working on a worksheet that has been protected off and on. I unprotected this AM, but XL will not allow changes and instructs to unprotect the WS, but it is already unprotected. The WB is not protected and never was. I am at a loss as to how to work around this problem.
We have created a spreadsheet that needs to be protected as it is viewed by several users. We would like, if possible, to update this daily with as little human intervention as possible.
Can we use VBE and the on worksheet open event to unlock the password protection, update the sheet and then lock it again? I know that you can read who opens the sheet using code similar to the following but don't know whether the password protection can be "unlocked" utilising this method.
I have an educational workbook which I am not familiar with. I cannot open vb project in vbe. When I try to open it says "project is unviewable". As far as I am concerned it should ask a password. But it doesn't. Can somebody tell me why. I am not asking somebody to crack it for me. I just want to learn why vbe doesn't ask a password. I think the only possibility is the creator of the program want nobody to open the code forever.
I need to be able to protect the sheets in this workbook but then I need them to be unprotected when I click the Save File As button and then have them saved again whenever the file is opened back up.