Posts by alring

    Re: Disable Cells


    You can also try this code here:



    This code should unlock cell A2 when you type in A1. Just remember to have cell A1 unlocked.
    Alring

    Hi


    I have made a userform where I calculate how long time an operation takes. If the time fe.g. is 25 hours and 24 minutes then I get the result 1:24.


    I have attached my userform as it looks now. If you write 540 in the bar and 550 in volume and press "Beregn" then "Norm tid + 10%" will write 1:24 and not 25:24.


    Is it possible to have the Userform to write 25:24 or 1day and 1 hour and 24minutes?


    Thank you in advance.
    Alring

    Files

    • exsamble.xls

      (36.35 kB, downloaded 257 times, last: )

    Re: Finding First Empty Cell


    Hi pangolin


    Thank you for the help. It works perfect when I changed the macro a little bit. I wanted that the value from cell C1 was going to be wroted in the empty cell. So I changed the macro to:


    Code
    1. Dim mycell As Range
    2. For x = 1 To 11
    3. Set mycell = Sheets("sheet1").Range("B9").Offset(x, 0)
    4. If IsEmpty(mycell.Value) = True Then
    5. mycell = Range("C1").Value
    6. Exit Sub
    7. End If
    8. Next x


    Krishnakumar: Because I wantet to have the value from Cell C1 then I can't use your code. But thank you for your time anyway.


    Alring

    Hi


    I want to use VBA to find the first empty cell in a colum. But I want VBA to start look for this empty cell after cell B10 and not from the top of the colum. I also want that the VBA stop looking after cell B20. The last part I already have (see below) but I don't know how to have VBA to start the search in cell B10 and not in the top.


    Code
    1. Range("B20").End(xlUp).Offset(1#).Value = Range("C1").Value


    This is what i have so fare. Can someone please help me with my question?


    Thank you in advance.


    Alring

    Re: Query with If Statement


    If it's text you write in cell E4 then try


    =IF(ISTEXT(E4);E3*H4;" ")


    if it's numbers you write in cell E4 then try


    =IF(ISNUMBER(E4);E3*H4;" ")


    You can also use


    =IF(OR(ISTEXT(E4);ISNUMBER(E4));E3*H4;" ")

    Re: Unlock a cell acording to another cell


    Sorry I forgot one thing. There will be orther cells on the sheet with text. And I don't want that is't possible for the user to change anything in those cells. That's why all cells have to be locked until the cell above have be filled out. It's not nessesary that the cells that the user have filled out is locked after the cell have be filled out.

    Re: Unlock a cell acording to another cell


    Hi,


    The cells are empty. I want that the user have to fill in cell C3 before he/she can write in cell C4. And C4 have to filled before they can write in cell C5. And so on and so on.


    Regards
    Alring

    Re: Unlock a cell acording to another cell


    It's me again.


    I have done what Doc wrote to me. And it's working perfect. I thoght it then was plug and play to do it with the next cells. But it's not. Now i have this code here:


    It will only onlock cell C4. When I then try to wite in Cell C5 then Excel tells me that the cell is protected.


    What am I doing wrong??


    Alring

    Hi there


    I am trying to make a sheet that is protected. It's protected in that way that all cells are protected and locked except cell C3. When someone then type anything in cell C3 and leave the cell then cell D3 automatic unlock. I know how to do it with a macro. But I don't want that the user have to press the macro-buttom to unlock cell D3. It should unlock cell D3 automatic.


    Is there someone that can help me with this "small" problem.


    Thank you in advance.


    Regards
    Alring

    Re: Continue macro


    Hi there


    I got it not. I have changed the code total after trying alot of different things. So now it's working. The code look like this now.


    Regards
    Alring

    Re: Continue macro


    Hi


    I have changed the last part of the code. It's the part after:


    Code
    1. Application.CutCopyMode = False


    I have changed it to:


    The path for the file is in A9 and the filename comes from D1 and D2. and it's working as it should.
    But I still need to put in a message box that will come if the file don't exist. I have tried to put the code for the message box in after "Exit For" but then I have to press OK 18 times before the message box disapear again.
    So if some one knows where I can write the code for the message box then I will be gratefull.
    Alring

    Re: Continue macro


    Hi Wigi


    This is a short code. the right one is very long because I open about 20 Word documents. But it's the last part where I want to open bNameAndPath that where I want to macro to see if the file (Range A10) is there and then print it. If it's not there then come with a message box saying it's not there and then end the macro.



    Alring