Posts by anka1829

    Re: Division Decimal Format


    Try with this code:


    Regards,
    Antonio

    Re: Continue Finding


    Try with this code (may be it's possible to do shorter code) that select the cell with a row number greater than current position (activecell):



    Regards,
    Antonio

    Re: Select Cell With Value I Type


    To try to use on another workbook/worksheet you can try to right click on your sheet label, choose code view and past this code:



    Regards,
    Antonio

    Re: Is Vlookup The Correct Method For Me?


    I used the match formula that look for data in a range and returns the row (not the absolute row but the row number in the range) where it found the information.


    For example, if you have these data in b1:b3 :
    "Example1"
    "Example2"
    "Example3"


    and write:


    =match("Example2";B1:B3;0) it will return '2' that is the row where it found the string "Example2"


    At this point to get other information on the same row I used the Index formula (range where to get data, row, column), for example:
    =INDEX(A1:E3;2;3) will return the information from cell 'C3'


    and replacing the row with the match formula it will return information from cell in column '3' or 'C' of the row where column 'B' has the information you were looking for.


    Regards,
    Antonio

    Re: Only Allow Workbook To Close If Data In All Cells


    No.


    You have to add the code at the workbook close event and so (only for this code) you have to do so:
    1) open excel
    2) open excel vb editor (usually keyboard 'Alt' and 'F11')
    3) on the left frame give double click on 'ThisWorkbook' (if you don't see the frame use keyboard shortcut 'Ctrl' and 'R')
    4) on the upper of the right windo there are two combo box (general and declaration)
    5) from the combo box on the left (general) choose Workbook
    6) from the right combo box choose 'BeforeClose' event
    7) here paste the code


    Regards,
    Antonio

    Re: Only Allow Workbook To Close If Data In All Cells


    I apologize for the bad color I used


    Re: Only Allow Workbook To Close If Data In All Cells


    I think it's better to modify the royUK code so:



    Because I think if you don't use the Cancel = true excel will close the workbook


    Regards,
    Antonio

    Re: Convert Basic To Vba


    See the attached file


    I only changed your code from Sub to Function and at the end of the function added one row of code


    Then I put the function in a module and I call it from the excel as a function.


    I hope it can help you.


    Regards,
    Antonio

    Re: Delete Cells Shift Left


    Try with this code... it may fix your problem.



    I hope this is what you need


    Regards,
    Antonio

    Re: Do Until And Crash


    DoEvents allows at operating system to execute other events.


    In other words, if you have a do until.... loop and you don't use DoEvents you may be serious problems to stop the execution while you have no problems if you use DoEvents because the system stop for a while the execution and then allows you to stop the execution.


    Use DoEvents also after an insert so excel can have a while to update.


    Another thing: in your Sub... End Sub try to define your variables so when you exit from the Sub the variable stop to exist:
    Private Sub Macro1()
    dim myVar1 as string


    End Sub


    when you exit from the Sub the variable doesn't exist.


    I hope it can help you


    Regards,
    Antonio