Posts by gollem

    Hi,


    welcome to ozgrid.


    if I understand correctly you want to fill in a cell for example "A1", press a button and go to a worksheet in the same workbook linked to that data?


    Or do you mean open another workbook? Be more specific.


    I'm not sure this is what you want:


    Code
    Select Case ActiveSheet.Range("A1").Value
            Case 32
                'select sheet1
                Sheets("sheet1").Select
                'If you want to open a workbook
                'workbooks.open "c:\test.xls"
            Case 64
                'select sheet2
                Sheets("sheet2").Select
        End Select


    Gollem

    Hi,


    it depends on the data and the things you wanna do.


    For example you have on sheet1 some data and you want them in another layout on another sheet, you can do this with formules.


    But I think an example is needed to have a good solution. Perhaps you can make a small example. Some data and the result...


    I need more info to know what you want to do.


    Gollem

    Hi,


    to select a heet in that workbook:


    Code
    activeworkbook.sheets("sheet1").select


    to retreive data from a cell:


    Code
    activeworkbook.activesheet.range("A1").value


    You can always check code by using the macro recorder, it's a good way to learn some simple commands.


    If you want more detailed information, you should post a workbook and explain which data should be transferred.


    Gollem

    Hi,


    I've done a little check and it seems that the Val function you use only gives rounded figure. You should try cdbl.


    Code
    TextBox1 = FormatPercent((cdbl(TextBox1) / 100), 1)


    First test this, if this not work try:


    Code
    TextBox1 = FormatPercent((cdbl(replace(TextBox1,".",",",1)) / 100), 1)


    I don't know if decimals you become use . or ,. In the example I replace the . by ,. It could be that you have to switch the two.


    Gollem

    Hi,


    why not use a listbox and adapt the properties so it looks like a label?


    (special effect => 0, backcolor => gray, ...)


    Gollem

    Hi,


    the first thing that I notice:


    txtbEffdate = CDate(txtbEffdate) is not necessary


    If you use Cdate() it has to be added:


    Code
    rngdefswap.Cells(iRow, 4).Value = Cdate(frmNewswap.txtbEffdate.Value )


    You can also try to add this code:


    Code
    rngdefswap.Cells(iRow, 4).NumberFormat = "mm-dd-\y\y\y\y"
    rngdefswap.Cells(iRow, 4).Value = Cdate(frmNewswap.txtbEffdate.Value )


    Perhaps the other guys have some other solutions.


    Gollem

    Hi,


    I'm not sure what the problem is. When is the code executed you mentioned:


    Code
    If ComboBox1.Value = "" Then
    MsgBox "Please select a company", vbInformation, "Select Company"
    End


    When you close the form, when you press a button?


    Gollem

    Hi,


    I don't know if you 've got a lot of programming experience but here's an idea:


    You should be some code when workbook opens:
    This code checks automatically every line of your sheet. You should built a loop to do this. The program should check the backcolor of the cell(if ... send mail, else do nothing) You also have to check if there is already an email send(see below). You don't want the program send an email every time you open your excel.


    You should pay attention that when you send a mail you put an extra field to your column with for example "SEND".


    This is just a basic thought.


    Gollem

    Hi,


    how do you store the textbox value in the cell?


    I assume something like this:


    Code
    activesheet.range("A1").value = txtbEffdate.text


    Try:


    Code
    activesheet.range("A1").value = CDATE(txtbEffdate.text)


    Change also the cell format before you test it.


    Gollem