1 / 8

Microsoft Excel VBA

Microsoft VBA stands for Visual Basic for Applications is the programming language of Excel and other Office programs.

techhelper
Télécharger la présentation

Microsoft Excel VBA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft Excel VBA: What is Microsoft Excel VBA: Microsoft VBA stands for Visual Basic for Applications is the programming language of Excel and other Office programs. VBA is powerful and productive about tedious answers for designing or remedy issues. For instance, have you ever changed the style of the section at the head of each page in Word? Have you ever needed to reformat various tables that were stuck from Excel into a Word record or an Outlook email? Have you ever needed to roll out a similar improvement in numerous Outlook contacts. VBA programs can be attached to a menu button, a macro, a keyboard shortcut. Where to find this Program:

  2. The organization run by the most extravagant man on the planet. Dominate, alongside different individuals from Microsoft Office 2003, incorporates the VBA language (at no additional charge). More or less, VBA is the device that individuals use to create programs that control Excel. Enabling the Developer Tab: To utilize VBA, you need the "Designer" tab empowered. The "Engineer" tab has a few fastens and highlights that upgrade the manner in which you make spreadsheets. In the event that you don't have the "Designer" tab empowered, follow these subsequent stages to empower it.

  3. Snap the "Record" strip tab, and afterward click the "Choices" connect that shows in the base left segment of the Excel window. This opens another design window where you can set inclination for various components of Excel. Snap the "Tweak Ribbon" choice in the left board. Creating a Button on Your Spreadsheet At the point when you click the "Addition" button, a dropdown shows the entirety of the accessible parts that you can add to your spreadsheets. The upper left control in the "Structure Controls" area has the catch control. You can float your mouse over every one of the parts in the rundown to perceive what you can add to a spreadsheet. On the

  4. off chance that you know about HTML page segments, at that point you will perceive a large portion of the accessible segments in the dropdown. Snap the catch control and afterward you can draw the catch on your spreadsheet. Drawing a catch lets you make it as extensive as little as you need. After you draw the catch, a window opens where you can allot a full scale. Working in the VBA Workspace: With the VBA supervisor open, you presently have a capacity prepared to alter for your catch. Anything you type in the "Sub" and "End Sub" articulations will run when you click the Button1 part. At the point when you begin working with VBA, you need to make simple capacity articulations so you can follow what is happening as the code runs. In this model, we will add some content to a cell inside the current spreadsheet. Inside the sub start and end phrases, type the accompanying code:

  5. The VBA workspace looks a similar whether you program macros in Word or Excel. It's where you can program the full scale and view all other code that you've recently made. Writing Some Simple VBA Code: Sub Demo() Dim rng As Range Dim PowerPointApp As Object Dim myPresentation As Object Dim mySlide As Object Dim myShape As Object 'Copy Range from Excel Set rng = ThisWorkbook.ActiveSheet.Range("A1:C12") 'Create an Instance of PowerPoint On Error Resume Next

  6. 'Is PowerPoint already opened? Set PowerPointApp = GetObject(class:="PowerPoint.Application") 'Clear the error between errors Err.Clear 'If PowerPoint is not already open then open PowerPoint If PowerPointApp Is Nothing Then Set PowerPointApp = CreateObject(class:="PowerPoint.Application") 'Handle if the PowerPoint Application is not found If Err.Number = 429 Then MsgBox "PowerPoint could not be found, aborting." Exit Sub End If

  7. On Error GoTo 0 'Optimize Code Application.ScreenUpdating = False 'Create a New Presentation Set myPresentation = PowerPointApp.Presentations.Add 'Add a slide to the Presentation Set mySlide = myPresentation.Slides.Add(1, 11) '11 = ppLayoutTitleOnly 'Copy Excel Range rng.Copy 'Paste to PowerPoint and position mySlide.Shapes.PasteSpecial DataType:=2 '2 = ppPasteEnhancedMetafile Set myShape = mySlide.Shapes(mySlide.Shapes.Count)

  8. 'Set .Left = 66 myShape.Top = 152 'Make PowerPoint Visible and Active PowerPointApp.Visible = True PowerPointApp.Activate 'Clear The Clipboard Application.CutCopyMode = False End Sub Happy Learning with Microsoft Excel VBA.

More Related