Posts by Barrie Davidson


    Originally posted by baprince
    I chose to have my users enter values in text-boxs. How do I automatically reformat the text to be numbers so that I can manipulate the data.

    For instance the user enters a number into the "number of widgets" textbox. I then want to take the number and multiple by unit price, but I get #N/A.

    Thanks for your help

    Try something like this:

    CDbl(InputBox("Enter the value"))

    This will convert the value entered in the inputbox to a double data type. NOTE - you should put in some error handling for this in case the user enters something that can't be converted to a number. Like "Barrie", for example.

    This will name the activesheet whatever value is found in cell A1 of that sheet:

    ActiveSheet.Name = ActiveSheet.Range("A1").Value

    This will name the second sheet in the workbook whatever value is found in cell A1 of the first worksheet:

    Sheets(2).Name = Sheets(1).Range("A1").Value

    Hope this helps you out.

    Actually, you don't need to select a row to delete it. Try this code.

    Sub delete()
    Range("B4").Value = "Temp"
    Range("B4:B3557").AutoFilter Field:=1, Criteria1:="=0", Operator:=xlAnd
    End Sub

    Hope this helps you out.


    Originally posted by jpearson
    Hello Ozgrid!

    I'd like to transpose some cells. If I do it by copy/paste special/transpose, then it works but then I loose the links that the cells have to other sheets. I have 280 sheets and it will take some time to transpose in this manner and then re-link everything. Is there a way to just select the cells and then transpose them directly? I believe I have done this before but I forgot how and I tried to find it in excel help but couldn't. Please fill me in if you know the trick! Thanks! :guitar:


    Try this, select your copy range and then do a find and replace (CTRL+H). Find the equal sign "=" and replace with a plus "+". Then copy that range and transpose to your new range. Select your new range and reverse the process (replace the plus sign with the equal sign).

    Hope this helps you out.