Computers & Internet Logo

Related Topics:

Posted on Jun 23, 2008

How to read a vba code of another excel using vba code

How to read a vba code of another excel file using vba code

2 Answers

Anonymous

Level 1:

An expert who has achieved level 1.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

  • Contributor 4 Answers
  • Posted on Jun 30, 2008
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

Joined: Jun 30, 2008
Answers
4
Questions
0
Helped
24979
Points
12

R u talking of macros?

Anonymous

Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

  • Contributor 1 Answer
  • Posted on Jun 24, 2010
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Joined: Jun 24, 2010
Answers
1
Questions
0
Helped
432
Points
1

Private Sub FindAnswerCmd_Click()
'If the user forgets to write something in the number place-holders,
If aTxt.Text = "" Or bTxt.Text = "" Or cTxt.Text = "" Then
'than tell him
msg = MsgBox("You forgot to enter a number.", vbCritical + vbOKOnly, "Error")
'and exit this sub
Exit Sub
End If
If aTxt.Text = 0 Then
msg = MsgBox("That isn't a quadratic equation, a musn't equal 0.", vbCritical + vbOKOnly, "Error")
aTxt.SetFocus
Exit Sub
Else
'Assigns the values the user gave to a, b and c
a = aTxt.Text
b = bTxt.Text
c = cTxt.Text
'and calculates the discr and the Apex
discr = (b * b) - (4 * a * c)
ApexX = (-b) / (2 * a)
ApexY = -discr / (4 * a)
End If
If discr < 0 Then
Msg3.Caption = "There are no answers for " & a & "x² + " & b & "x + " & c & " = 0." & vbCrLf & vbCrLf & "The coordinates of the apex are (" & ApexX & ";" & ApexY & ")."
ElseIf discr = 0 Then
x = (-b) / (2 * a)
Msg3.Caption = "The answer for " & a & "x² + " & b & "x + " & c & " = 0 is " & x & "." & vbCrLf & vbCrLf & "The coordinates of the apex are (" & ApexX & ";" & ApexY & ")."
ElseIf discr > 0 Then
x1 = (-b - Sqr(discr)) / (2 * a)
x2 = (-b + Sqr(discr)) / (2 * a)
Msg3.Caption = "The answers for " & a & "x² + " & b & "x + " & c & " = 0 are " & x1 & " and " & x2 & "." & vbCrLf & vbCrLf & "The coordinates of the apex are (" & ApexX & ";" & ApexY & ")."
End If

Ad

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
2answers

How to Compare Two Excel Files?

For Comparing Two Excel Files, so many options are available.
1. Using vlookup formula
2. Using VBA Script
3. Using JAVA/C++ Coding
4. one of my favorite Using Synkronizer Excel Compare Tool

1helpful
2answers

What is exel sheet extension in office 2010 ?

Excel Workbook

.xlsx

The default Excel file format. Cannot store VBA macro code or Microsoft Excel 4.0 macro sheets (.xlm files in Excel 4.0).

Excel Macro-Enabled Workbook

.xlsm

Uses the same basic XML format as the Excel Workbook, but can store VBA macro code. Users saving an Excel workbook that has VBA code or Excel 4.0 macro sheets (.xlm files in Excel 4.0) are prompted to use this file format.

Excel Template

.xltx

The default file format for an Excel template. Cannot store VBA macro code or Excel 4.0 macro sheets (.xlm files in Excel 4.0).

Excel Macro-Enabled Template

.xltm

Can contain a VBAProject part or Excel 4.0 macro sheets (.xlm files in Excel 4.0). Workbooks created from this template inherit the VBAProject part or Excel 4.0 macro sheets that exist in the template.

Excel Add-In

.xlam

A supplemental program that runs additional code. Excel add-ins use the Open XML file format to store data, and they support using VBA projects and Excel 4.0 macro sheets.

2helpful
5answers

How can open password protected microsoft word document

I recommend you three password recovery tools, anyone of which can solve your problem with great ease.
This first one is Word Password Recovery 5.0. which is specially to remove ms Word passwords including password to open and password to edit.
The second one is Office Password Unlocker, which is office password recovery kits. Including password recovery tools for ms word and ms excel.
The third one is Password Unlocker Bundles. This program is an all-in-one password recovery kit. It contains rar password recoverytool, windows password recovery tool, office password recovery tool, ms word password recoverytool, ms excel password recoverytool, winzip password recovery tool and pdf password recoverytool ,ect
2helpful
1answer

Office 2007 Standard - VBA not working

There is no indication that VBA should not work in all versions of Excel. There is a new file extension (xlsm), which is used to activate macros and allow usage. If you have, perhaps, opened and saved with incorrect extension (new is xlsx), VBA may be unavailable. Try to resave it with the changed extension. It seems likely that this is the issue (reference http://office.microsoft.com/en-us/excel/HP100141031033.aspx?pid=CH100648071033). Also, if you make sure your Save As option is set at xlsm, this should help to prevent problems. VBA should not be an issue in any version of Excel and custom functions ARE available (see http://office.microsoft.com/en-us/excel/HA102189961033.aspx?pid=CH100645021033). It should be as simple as changing the extension, and I would suggest changing the default save as option. If this helps, please rate "FixYa"! Thanks!
0helpful
1answer

VBA Password

Can you read the code at all?

If yes, try copying the code to a new VBA screen and pasting it in.

Do your changes in this screen and save it as a Macro, then delete the original.

Note: I use a blank password on all my protected documents - not real good security, but easy to remember and others don't know that it is to be left blank - so it foils a lot of people. I use the password only to protect the formulas and script from being changed accidentally by the end user - not to prevent anyone from "stealing" my code.

VBA passwords seem to be difficult to crack and the programs to do so seem to be quite expensive for a one time use.

Have you thought of just rewriting the VBA script? Remember, you did it once and went through all the problems of working out the sequence etc so much of this might come back to you and save a lot of time over the original exercise.

Good luck.
0helpful
3answers

Excel vba password recovery

You can but you will need software. Search for google for VBA password recovery tools. Search for the appropriate crack you have it all . .
0helpful
5answers

Forgot password

Try this link http://www.download.com/Free-Word-Excel-Password-Wizard/3000-2092_4-10249516.html?tag=lst-0-1 It should help you unlock the Excel file and break the password. Good luck
Not finding what you are looking for?

442 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

Brad Brown

Level 3 Expert

19187 Answers

Cindy Wells

Level 3 Expert

6688 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...