|
-
Oct 23rd, 2005, 10:03 PM
#1
Thread Starter
New Member
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
-
Oct 23rd, 2005, 11:48 PM
#2
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:
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Oct 24th, 2005, 01:00 AM
#3
Thread Starter
New Member
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.
-
Oct 24th, 2005, 02:07 PM
#4
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:
Application.Workbooks("Book1").Sheets("Sheet1").Select
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|