Posts by Craig Ottley

    Re: How to display Column names in Excel sheet when I retrieve data from MySQL

    This should do the trick!

    Re: Syntax error in DoCmd.RunSQL Access command

    Hi Shenlung,

    I think your syntax error is next to your where clause. You seem to have an extra apostrophe after the comma???

    Try this...

    Re: Formulas into custom vba functions

    Will an IF statement solve your problem??


    If CDbl(Dir1.Value) = 0 And CDbl(Dir2.Value) = 0 And CDbl(Spd1.Value) = 0 And CDbl(Spd2.Value) = 0 Then
            udfGetGFSMOS = 0
        udfGetGFSMOS = WDR
    End If

    Re: Formulas into custom vba functions

    OK let's tackle one step at a time...

    This requires a reference to be set in VBA. Make sure the Analysis Tool pack is selected in the Add-Ins, then in VBA select Tools--> References and then tick atpvbaen.xls

    Try the following code to see if it yields the expected result with known values.

    Re: Formulas into custom vba functions

    Hi wxchic,

    This could probably do with some cleaning up but it seems to do the job...


    Re: Formulas into custom vba functions

    Hi wxchic,

    If you've already got this working as a formula, you won't gain any performance using VBA...

    What exactly do you want returning? A function for WD and a function for RWD? or just a singular number?

    Re: VBA code to refresh different sheets based on the days date

    If you've got access to Visual Studio you create an executable that creates an Excel Workbook. You can call the db procedures that populates the workbook and then setup a scheduled task...

    I wouldn't recommend creating a scheduled task for excel as it imposes a security risk as you'd need to trust macro's without prompting.

    What options do you have available?

    Re: vba goto specific cell excel


    Welcome to Ozgrid. If you want to write data to a specific cell you can use a one line piece of code...


    Sub writeValueToCell()
    Sheet1.Range("A1903").Value = "Summary"
    End Sub

    If you need more examples there are thousands available on this site.