Posts by alring

    Re: Text in inputbox


    Hi thomach


    Thank you for your reply :thanx:


    I have tried to run the macro with and without Option Explicit and the macro works in both ways. The mistake I made with your code was still to have As long instead of As String.


    Alring

    Re: Text in inputbox


    Hi Will


    Also thank you to you for your reply. :thanx:


    I was using Long because it was working with the numbers in another macro. Now I can see that I can use string no matter if it's letters or numbers. But I will remember the numbercodes you gave me.


    Alring

    Re: Text in inputbox


    Hi Thomach


    Thank you so much for your help. It works :thanx:


    I can see that you wrote in the beginning of the macro:


    Code
    1. Option Explicit


    I tried the macro without that code and then it didn't work. So what does that do with a macro??


    Alring

    Re: Text in inputbox


    Sorry!!!!!


    Code
    1. With Ark1


    Should have been:


    Code
    1. With Sheet1


    The reason for the mistake is that my Excel is danish.


    Alring

    Hi there


    I have this code here. But when I run it then the only thing I can right in the inputbox is numbers. But I want to write letters in the inputbox. What is wrong with the code?? :?


    Please someone help me.



    Alring

    Re: If function in VBA


    Hi Fengore and Dave


    I have solve the problem. Both of you thnak you for your help. :thanx:


    The code work when it look like this:



    Again. Thank you :thanx:


    Alring

    Re: If function in VBA


    Hi Dave


    Thank you for your reply. :thanx:
    There is just one small problem. I would like to use .cells(1,1) and .cells(2,1) and .cells(3,1) instead of A1 and A2 and A3. I have tries to change your code to that but I can't get to work. Maybe it's because it's not possible. or maybe I write the code wrongly. The last thing is very possible. :? Is it possible to use .cells instead of letter and number for the cells??


    Alring

    Hi there


    I have (for me) a big problem. In the attached document I have a formula in cell D7. D7 links to cell A7:A9. And it works. Now I want that I can do the same thing in VBA but the result should be in cell D1. D1 links to cell A1:A3.


    I have made the formula in cell D7 to explain what it is I want . I'm not going to use that one in the future but only the VBA code.


    Please someone help me.


    Alring

    Files

    • if cells.xls

      (25.6 kB, downloaded 17 times, last: )

    Re: Conditinal formatting according to text


    Hi Bob


    If I write the code like this then it works



    If I don't write


    Code
    1. Case Else
    2. icolor = 2


    Then will all the cells that is ampty under one cell that is not empty be the same color as the one above.


    Alring

    Re: Conditinal formatting according to text


    Hi Roy


    It seems that it's only working when I write text in Range (A1:A10). But I don't write text in these cells. I make a vlookup and the result from there is written in cella A1:A10. And when I do that then the color don't change.


    regards
    Alring

    Hi there


    I have been reading the code for conditinal formatting, so it's posible to have more than 3 rules (see below):



    This one is for numbers but I have text instead. I have different kind of text that I find with lookup. Now I want to color the cell according to the text that I find during the lookup.


    Regards
    Alring

    Re: Colour cell


    Hi Andy


    Thank you for your exsamble. Now i could see what I was doing wrong. I copied your formela and didn't change "," to ";".


    SORRY :gift:


    But anyway thank you for your reply. :thanx:


    Alring

    Re: Colour cell


    I have a macro that look like this:


    Sub colour_Click()


    If Range("A2") = "l" Then
    Range("B2").Select
    Selection.FormatConditions.Delete
    Selection.FormatConditions(1).Interior.ColorIndex = 3
    End If


    End Sub


    But it don't work.

    Re: Colour cell


    Hi Andy


    It seems that it doesn't work. I can only get it to work when I tehn also write "=Or($A$1="L",$A$1="S") " in cell B1. But B1 is empty.


    Alring