Friday, January 27, 2012

To open the embedded file from PPT Presentation Mode (Slideshow)


If you would like to open the embedded file from PowerPoint Presentation Mode, you have to make the following settings:



Single Click (Left click) on the embedded file in the slide.

Select Insert -> Action from Toolbar


Under “Mouse Click”, select “Object action” and select “Open” from the option and click OK.


Now you can open your embedded file, even if the PPT is in presentation Mode.

Tuesday, January 24, 2012

To Copy Charts from Excel to PPT using Macro

Using macro you can automate the process of copy the ranges and charts from excel to PPT.

The sample code is :

Sub Chart2PPT()
Dim objPPT As Object
Dim objPrs As Object
Dim objSld As Object
Dim shtTemp As Object
Dim chtTemp As ChartObject
Dim objShape As Shape
Dim objGShape As Shape
Dim intSlide As Integer
Dim blnCopy As Boolean

Set objPPT = CreateObject("Powerpoint.application")
objPPT.Visible = True
objPPT.Presentations.Add
objPPT.ActiveWindow.ViewType = 1 'ppViewSlide

For Each shtTemp In ThisWorkbook.Sheets
blnCopy = False
If shtTemp.Type = xlWorksheet Then
For Each objShape In shtTemp.Shapes 'chtTemp In shtTemp.ChartObjects
blnCopy = False
If objShape.Type = msoGroup Then
' if ANY item in group is a chart
For Each objGShape In objShape.GroupItems
If objGShape.Type = msoChart Then
blnCopy = True
Exit For
End If
Next
End If
If objShape.Type = msoChart Then blnCopy = True

If blnCopy Then
intSlide = intSlide + 1
objShape.CopyPicture
' new slide for each chart
objPPT.ActiveWindow.View.GotoSlide Index:=objPPT.ActivePresentation.Slides.Add(Index:=objPPT.ActivePresentation.Slides.Count + 1, Layout:=12).SlideIndex
objPPT.ActiveWindow.View.Paste
End If
Next
If Not blnCopy Then
' copy used range
intSlide = intSlide + 1
shtTemp.UsedRange.CopyPicture
' new slide for each chart
objPPT.ActiveWindow.View.GotoSlide Index:=objPPT.ActivePresentation.Slides.Add(Index:=objPPT.ActivePresentation.Slides.Count + 1, Layout:=12).SlideIndex
objPPT.ActiveWindow.View.Paste
End If
Else
intSlide = intSlide + 1
shtTemp.CopyPicture
' new slide for each chart
objPPT.ActiveWindow.View.GotoSlide Index:=objPPT.ActivePresentation.Slides.Add(Index:=objPPT.ActivePresentation.Slides.Count + 1, Layout:=12).SlideIndex
objPPT.ActiveWindow.View.Paste
End If
Next

Set objPrs = Nothing
Set objPPT = Nothing
End Sub

For any Custom Macro or Excel solution

If you need any cutom macro require for your work and soultion that you are facing with excel data or fromatting, you can contact me on Fiverr.

I just became a Level 2 seller on #Fiverr.com (@FiverrHQ). Check out my cool gigs:

http://5rr.it/s/qxtj

VLOOKUP Formulae

VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

Lookup_value The value to search in the first column of the table array (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.). Lookup_value can be a value or a reference. If lookup_value is smaller than the smallest value in the first column of table_array, VLOOKUP returns the #N/A error value.

Table_array Two or more columns of data. Use a reference to a range or a range name. The values in the first column of table_array are the values searched by lookup_value. These values can be text, numbers, or logical values. Uppercase and lowercase text are equivalent.

Col_index_num The column number in table_array from which the matching value must be returned. A col_index_num of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. If col_index_num is:

Less than 1 VLOOKUP returns the #VALUE! error value.
Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.
Range_lookup A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match:

If TRUE or omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.
The values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP may not give the correct value. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending. For more information, see Default sort orders.

If FALSE, VLOOKUP will only find an exact match. In this case, the values in the first column of table_array do not need to be sorted. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.

Monday, January 23, 2012

Record a simple Macro

The simple way to start learning macro is "Record Macro" To record a macro in excel 2007 follow this path:

View -> Macros -> Record Macro



Then a new window opens with required specification like Macro name, Shortcut key, store macro in, Description

Note:

The Macro name should not conatin any blanks spaces or any special characters

For shortcut key, avoid usual shortcut keys like Ctrl+v, Ctrl+v etc.,







Once you clicked OK the macro start to record all your activities that you are doing in that excel. To stop the record, again go to views_> Macro-> Stop recording

Introduction to Macro

When you find yourself repeatedly performing the same actions or tasks in your spreadsheets, it might be time for you to create a macro. A macro is a recording of each command and action you perform to complete a task. Then, whenever you need to carry out that task in your spreadsheets, you just run the macro instead.

Macros can be activate by a couple of keystrokes or by a worksheet button so they are easy to execute, and, provided they were recorded correctly, they will always carry out the same steps in the same order with no chance for operator error.

Although complex macros can be created in Excel using the Macro editor, it also possible to create relatively simple ones using the Excel macro recorder. If you are new to using macros in your spreadsheets, this is the right place for you to learn macros