Wednesday, February 13, 2013

Hide everything but the working area in an Excel worksheet

Takeaway: Hiding unused cells makes it easier for users to focus on their worksheet data. 
Here’s an easy way to clear the decks and simplify the display.

You usually hide a column or row to conceal or protect data and formulas. But you can also hide unused regions of a sheet to keep users from exploiting unused areas or to help keep them on task by not allowing them to wander. By hiding unused rows and columns, you present a sheet that focuses on just the work area. To demonstrate, we’ll use the sample worksheet shown in Figure A, which has a small working area and a whole lot of unnecessary rows and columns.

Figure A


To hide unused rows in Excel 2003, select the row beneath the sheet’s last used row. (Select the row header to select the entire row.) Next, press Ctrl + Shift + Down Arrow to select every row between the selected row and the bottom of the sheet. Then, choose Row from the Format menu and select Hide. Repeat this process to hide unused columns, only select the column header in the first empty column. Press Ctrl + Shift + Right Arrow and then choose Column from the Format menu instead of Row.
In Excel 2007, the selection process is the same. However, you’ll need to click Format in the Cells group on the Home tab, choose Hide & Unhide, and select Hide Rows (Figure B) and Hide Columns.

Figure B


Note: Before you hide anything, make sure you don’t inadvertently hide an obscure area. To find the last cell in the sheet’s used range, press Ctrl + End.
Figure C shows our worksheet with the extraneous rows and columns hidden — a cleaner, less busy interface for your Excel users.

Figure C


Restoring the display

If you need to unhide the rows and columns, first select the entire sheet. Then, in Excel 2003, choose Row or Column from the Format menu and select Unhide. In Excel 2007, click Format in the Cells group on the Home tab, choose Hide & Unhide, and select Unhide Rows (or Unhide Columns).

Source

Sunday, February 10, 2013

Change the formatting of text to match the your style in Excel while doing copy-paste

 If you want to copy-paste text and want it should copy-paste automatically matching your style , then  copy the below code in "thisworkbook" of you excel


Private Sub WorkBook_Open()

  'MsgBox "this happens when workbook is opened"
    Application.OnKey "^v", "my_paste"
    '--------------call macro Paste option set to my style
End Sub
Option Explicit

Sub my_paste()
    MsgBox "you have pressed ctrl+v"
'Enter the password if your sheet is protected .
'worksheet.Protect Password:="urPassword", UserInterFaceOnly:=True, AllowFormattingColumns:=True, AllowFiltering:=True

'enter here your sheet style which is to be matched.
        Selection.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
        False, NoHTMLFormatting:=True, SkipBlanks:=False, Transpose:=False
   
End Sub

Coverts Display Hyperlink to Address of Link Hyperlink

If you want to convert  the hyeprlink display address to Actual address of Hyperlink  , We can do as below

Sub x()
    
     ' Select a range or column first! Enter the range you want to look in for
     Columns("A:A").Select

         Dim lngTemp As Long
    
    For lngTemp = 1 To Selection.Hyperlinks.Count
        
        Selection.Hyperlinks(lngTemp).TextToDisplay = Selection.Hyperlinks(lngTemp).Address
        
    Next
    
End Sub