Results 1 to 4 of 4

Thread: Need Help on this project

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Need Help on this project

    Hi all,

    I'm new in this forum and I sign up as i believe the guys here can help me with the problem on macro that I have.

    Well firstly I need to write a macro that prompt me to select a file so that I can use that selected file data to calculate the average, max , min and standard deviation.

    I have no idea how to go about doing it. I have tried putting the functions of the average, max, min and standard deviation to the worksheet but it only allows me to get data from fixed location when I run macro.

    Hope someone can help me with this.

    Thanks very much.



    Best regards
    tkl

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Need Help on this project

    Welcome to the Forums.

    Sounds like this is being done in Excel?

    You can use the GetOpenFileName method to present the Open File Dialog box.

    VB Code:
    1. Application.GetOpenFilename FileFilter:="Excel Workbooks Only (*.xls),*.xls", FilterIndex:=1, Title:="Select Excel Workbook", MultiSelect:=False
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    3

    Re: Need Help on this project

    HI Moderator,

    THanks for the reply. Yes you are right. It's use in the excel however I'm not very good at it in executing a macro to do the above mentioned task. Maybe you can help me with this?

    So after I choose my file, how can I write micro so that It can transfer the data to another fixed file where i can use for calculations?

    THanks very much.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Need Help on this project

    Here is how you can select a sheet and copy/paste it into another already opened workbook.
    VB Code:
    1. Application.Workbooks("Book1").Sheets("Sheet1").Select
    2. Application.Workbooks("Book1").Sheets("Sheet1").Copy After:=Application.Workbooks("Book2").Sheets(3)
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width