Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Grafton54

    Command button to increment a cell by 0.1

    Just to add that you should check if the value is a number before adding, as you may get an exception if you try to add to a string. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) With Target If IsNumeric(.Value) then .Value = .Value + 0.01 End...
  2. Grafton54

    For next loops - question

    Some of you familiar with C may know the "continue" command, for example: for (i=0; i<5; i++) // equivalent to For i = 0 To 5 in VB { if (some condition) cpntinue; some statement; } // In VB this would say Next i In this case, if "some condition" is satisfied, then instead of...
  3. Grafton54

    Selecting cells in Excel using variables

    Thank you for all your replies. Using Range(Cells(1, 1), Cells(i, 8)).Select worked wonders.
  4. Grafton54

    Selecting cells in Excel using variables

    I need to select a range of cells from (1,1) to (i,8), where i is variable computed during the execution of my VBA routine. Microsoft documentation (and my book) shows a way you can select the cells if the co-ordinates are hard-coded, e.g. range("a2:b3").select However, how do you do that if...
  5. Grafton54

    Custom message boxes

    For your reference, one of the pages I found (http://www.officecomputertraining.com/vbtutorial/tutpages/page16.asp) for the MsgBox function, lists the options for the buttons as follows: vbOkOnly vbOkCancel vbRetryCancel vbYesNo vbYesNoCancel vbAbortRetryIgnore
  6. Grafton54

    Custom message boxes

    I want to create a message box with the text "Which plant are you upgrading?" and three buttons: "Live" "Test" and "Cancel". The text is not difficult to produce, but I do not know how to generate the buttons. I have searched the help instructions of the MsgBox function but it seems that the...
  7. Grafton54

    Password that user can manage

    Claus, Thank you for your reply. I can understand your requirements now. Unfortunately I am not an expert in the subject, so do not take what I say as gospel. With the default password protection functionality of Excel, you will be prompted to enter the password when opening the document (if...
  8. Grafton54

    Password that user can manage

    Claus, I am not exactly sure what you mean by your dedicated method. Can't you simply have a macro which pops up a dialogue box prompting the user to enter a password, then when the user clicks OK, automatically change the password settings of the workbook? You can set up a button or menu...
  9. Grafton54

    Problems with copying times

    It worked. Many thanks. I never knew .Text before as it is not even mentioned in my VBA book!
  10. Grafton54

    Password that user can manage

    I hope this is not too late for you. Do you mean something like this? http://www.j-walk.com/ss/excel/faqs/protectionFAQ.htm If you want a macro which changes the password to a new one supplied by the user. Just record a quick macro of the operation, then view the code generated automatically...
  11. Grafton54

    Problems with copying times

    I am trying to copy a cell containing a time to another using .value but this results in a decimal! Try running this on your computer: Cells(1, 1).Value = "18:00" Cells(1, 2).Value = Cells(1, 1).Value In the first cell, the value is 18:00, but the value in the second cell is 0.75! (=18/24...

Part and Inventory Search

Back
Top