Question about Compilers & Programming Tools

2 Answers

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

Posted by on

2 Answers

  • 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

R u talking of macros?

Posted on Jun 30, 2008

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

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

Posted on Jun 24, 2010

Add Your Answer

Uploading: 0%

my-video-file.mp4

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

×

Loading...
Loading...

Related Questions:

1 Answer

How to convert vba macros to visual studio?


  1. Clean your code. There are built in Application specific functions which don't work in VB Studio. Some will require you pre-load the application first, others just don't work at all.
  2. Save the VBA module as a BAS file. This is just a text file with the module code in it.
  3. Export your forms to file.
  4. Open Visual Studio
  5. Import your forms and modules
  6. Clean it up.
  7. Compile it

Apr 28, 2010 | Microsoft Visual Studio 2008 Professional...

Tip

Computer Tips: Open Office 2007 Files into Office 2003


How to open office 2007 files into Office 2003?
Today tip will help you to resolve the compatibility issues between the Office 2003 and Office 2007. Because all programs in office 2003 used the old file extensions for its different programs. For example Word 2003 saved files with extension .doc, Excel 2003 with .xls and PowerPoint with .ppt. but on the other office 2007 used the new file extensions for its different programs. For example Word 2007 saved files with extension .docx, Excel 2007 with .xlsx and PowerPoint with .pptx. Now the problem is that when you will try to open office 2007 files into office 2003 and you will not open the file due to compatibility issues between both office versions. Microsoft provides a free compatibility pack to convert office 2007 documents to the office 2003 format. There are many third party free converter are available but here we are using Microsoft office compatibility pack.
Follow the given steps to download free Microsoft compatibility pack and install it.
To use this feature, you will need to be logged into your computer with administrative rights.
Visit the following link to download the Microsoft compatibility pack:
http://www.microsoft.com/downloads/details.aspx?FamilyId=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displaylang=en
When you have downloaded the file, double click on FileFormatConverter.exe file to start the installation.
7154964.pngNow here it’s simply a case of pretending you’ve read the license terms and clicking continue.
c448e59.png
Now click on OK button to complete the installation.


2dbe682.png

on Mar 08, 2010 | Compilers & Programming Tools

1 Answer

My OS is windows xp professional and my MS office is 2007 version.. people are unable to view the files i send them..especially word and excel.. pls help me


Office 2007 saves files in a new set of formats by default. If you colleagues cannot read these files, likely they are not using software compatible with these formats.

You can save these file in other formats by opening the relevant document in Office 2007 and, under "FILE" click "Save As..." and save the document in a compatible format; .doc instead of .docx, for example.

Apr 06, 2010 | Microsoft Compilers & Programming Tools

1 Answer

In microsoft excel sheet how do we copy zodiac signs written in front of employee from one sheet to another by writing a formulae in the blank space eg 1 amit scorpio 2 divik saggitarius 2 tisha...


When the cell is in a different sheet in the same file use:
=sheet-name!cell-name as in =Sheet1!A1

If the cell you want is in a different sheet in a different file use:
=[file-name]sheet-name!cell-name

as in: ='[sample excel 2.xls]Sheet1'!$A$1

The easiest way to do it is in the blank cell, type an equals sign "=" then go to the cell you want to copy, then press enter. All the correct formatting will be handled for you. (Sometimes you need quotes when you have spaces in the filenames and or sheet names.)

Sep 06, 2009 | Compilers & Programming Tools

1 Answer

Can i get vba code to list objects in a group in listbox1 without ungrouping the object?


You can look at each item in the Groupitems collection of a group. Those are the shapes if they are grouped.:

Sub group()
For Each one In ActiveSheet.Shapes
If one.GroupItems.Count > 0 Then
For Each one2 In one.GroupItems
MsgBox (one2.Name)
Next
End If
Next
End Sub

Mar 17, 2009 | Microsoft Compilers & Programming Tools

1 Answer

Write into excel format


Your code does not save in access format it just makes a copy of existing file. You need to open table by table and export data using csv format.
It can be done using access OLE to export, or
write some VB code to access the database tables via ODBC and save row data to csv file

Feb 17, 2009 | Microsoft Visual Basic Professional...

1 Answer

Write into excel format


You can use ADO or SQL to open the excel file directly (provided it is constructed correctly, ie fields names) and write the data to it without Access.
That might be eaiser thatn converting it from Access to Excel, if that can even be done.

Feb 17, 2009 | Microsoft Visual Basic 6.0 for PC

2 Answers

SPREADSHEETS


Excel is not able to be programed like that and still retain the data. Create 12 monthly spreadsheets and use them as they are needed.

Dec 08, 2007 | Compilers & Programming Tools

Not finding what you are looking for?
Compilers & Programming Tools Logo

Related Topics:

423 people viewed this question

Ask a Question

Usually answered in minutes!

Top Compilers & Programming Tools Experts

Robin Hill
Robin Hill

Level 3 Expert

1251 Answers

Fred Block
Fred Block

Level 2 Expert

289 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18299 Answers

Are you a Compiler and Programming Tool Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...