Monday 3 November 2014

How To Format USB Drive with NTFS File System

In Windows for formatting USB Drive only FAT or FAT32 Option is there if you wish to enable and use NTFS Format Option then continue reading this article
What are the Advantages Of NTFS
?
The advantage of NTFS file system is more security options and fast. Normally USB drive capacity is very small enough that NTFS is not recommended But, nowadays USB drives are coming with larger capacity also . So we can format USB drive with NTFS to have more security options

NTFS enabled USB Drives are write-able only on one PC and becomes read only on all other PCs. Hence , we can read and write on our own PC and transfer files to elsewhere without any fear of virus.

In Windows XPonly FAT and FAT32 file systems are available in format options use the below steps to format in NTFS File System.
  • Insert USB drive in your PC 
  • Go to Device Manager (Start > Run  > devmgmt.msc)
  • Select Disk Drives and expand.
  • Right Click on USB drive and select Properties.
  • Go to policies tab and select Optimize for performance and press OK 
  • Now Right click on USB Drive and select Format Option.
Now you can select NTFS option there on the pop up.

Friday 28 March 2014

Remove Gridlines From excel sheet

Fed up with watching gridlines in you excel sheet ?

Steps

1. Open your worksheet , Go to Tools Menu > Options 
2. In View Tab , You can see Window Options 
3. By Defult Gridlines are ticked, Untick it , Click ok Button

Then You have it


Note: If you want to change color of gridlines, there is an option under it, change gridlines color in it & Tick Gridlines.

Give Superb look for your excel sheet

1. Remove Annoying Gridlines from your sheet Click here

2.Remove Page Breaks

Steps
1. Open your worksheet , Go to Tools Menu > Options 
2. In View Tab , You can see Window Options 
3. By Defult Page Breaks are ticked, Untick it , Click ok Button

3. Remove Row & Coloumn Headers 

 Steps
1. Open your worksheet , Go to Tools Menu > Options 
2. In View Tab , You can see Window Options 
3. By Defult Row & Coloumn Headers  are ticked, Untick it , Click ok Button

4. Remove Scroll bars

Steps
1. Open your worksheet , Go to Tools Menu > Options 
2. In View Tab , You can see Window Options 
3. By Defult Horizondal Scroll bars & Vertical Scroll bars  are ticked, Untick both  , Click ok Button

5. Remove sheet Tabs
Note: Only Use this option if you have only 1 worksheet / you have hyperlinks to other sheets.
Steps
1. Open your worksheet , Go to Tools Menu > Options 
2. In View Tab , You can see Window Options 
3. By Defult sheet Tabs  are ticked, Untick it  , Click ok Button

Excel Worksheet Shortcuts - Very useful


ActionKey
Moving Forward to next worksheetCtrl + pagedown
Moving Backward to next worksheetCtrl+ Pageup
Selecting Multiple worksheets- ForwardCtrl + Shift + pagedown
Selecting Multiple worksheets- BackwardCtrl + Shift + pageup


Excel Shortcuts: Selecting

These shortcuts help you to quickly select items in your Excel file in various ways.
  • Shift+Spacebar: Select the current Row
  • Ctrl+Spacebar: Select the current column
  • Ctrl+A: Select All, will select everything on the current worksheet. This is most often used in conjunction with the copy shortcut.

Friday 10 January 2014

Excel VBA Macros Interview Questions & Answers - Part II



1. What is the difference between ByVal and ByRef and which is default ?
Solution: ByRef: If you pass an argument by reference when calling a procedure the procedure access to the actual variable in memory. As a result the variable's value can be changed by the procedure.
ByVal: If you pass an argument by value when calling a procedure the variable's value can be changed with in the procedure only outside the actual value of the variable is retained.
ByRef is default: Passing by reference is the default in VBA. If you do not explicitly specify to pass an argument by value VBA will pass it by reference.

2. What is the meaning of Option Explicit and Option Base?
Solution:

Option Explicit makes the declaration of Variables Mandatory while Option Base used at module level to declare the default lower bound for array subscripts. For eg. Option Base 1 will make the array lower bound as 1 instead of 0.


3. What are various data type and their size?
Solution:

i) The Boolean data type has only two states, True and False. These types of variables are stored as 16-bit (2 Byte) numbers, and are usually used for flags.
ii) The Byte data type is an 8-bit variable which can store value from 0 to 255.
iii) The Double data type is a 64-bit floating point number used when high accuracy is needed.
iv) The Integer data type is a 16-bit number which can range from -32768 to 32767. Integers should be used when you are working with values that can not contain fractional numbers. In case, you're working over 32767 rows use Long as data type.
v) The Long data type is a 32-bit number which can range from -2,147,483,648 to 2,147,483,647.
vi) The Single data type is a 32-bit number ranging from -3.402823e38 to -1.401298e-45 for negative values and from 1.401298e-45 to 3.402823e38 for positive values. When you need fractional numbers within this range, this is the data type to use.
vii) The String data type is usually used as a variable-length type of variable. A variable-length string can contain up to approximately 2 billion characters. Each character has a value ranging from 0 to 255 based on the ASCII character set.

4. Code to find a Last used Row in a column or Last used column of a Row.
Solution:
Last Row in a column can be find using End(xlUp) from the last Cell and Last Column in a row can be find using End(xlToLeft). For e.g. Range("A1048576").End(xlUp).Row gives last used row of Column A.

5. Difference between ActiveX and Form Controls.
Solution:

i) Forms controls can be used on worksheets and chart sheets. Forms controls can also be placed within embedded charts in Classic Excel (though not in Excel 2007). ActiveX controls can only be used on worksheets. ActiveX controls do not work in MacExcel.
ii) The Forms controls aren’t very complicated, and they have been part of Excel for longer (they were used in Excel 5/95’s dialog sheets) than the Controls Toolbox (Excel 97), so it stands to reason that they’d be more seamlessly integrated. Being newer, the ActiveX controls have richer formatting possibilities. Both can link to cells and ranges in the worksheet.


6. What is the difference b/w Functions and Subroutines?
Solution: There are so many differences. I noted few.
i) Subroutines never return a value but function does return values.
ii) A function could not change the values of actual arguments whereas a subroutine could change them.
iii) A subroutine cannot be used in a worksheet
iv) A subroutine can manipulate the any objects. A Function Cannot.
v) A function will not be listed in the names of macros
 
7. How to debug a VBA code?

Solution:
Using Breakpoints(F9), Step-by-step execution (F8), Debug.Print & Immediate Window and Watch window.

8. Draw basic Excel Object Model.
Solution:
Application --> Workbooks --> Worksheets --> Range / Chart

9. What are properties, methods, events and objects?
Solution:
For details click here --> http://msdn.microsoft.com/en-us/library/ms172576%28VS.80%29.aspx
All the controls in the ToolBox except the Pointer are objects in Visual Basic. These objects have associated properties, methods and events.
A property is a named attribute of a programming object. Properties define the characteristics of an object such as Size, Color etc. or sometimes the way in which it behaves.
A method is an action that can be performed on objects. For example, a cat is an object. Its properties might include long white hair, blue eyes, 3 pounds weight etc. A complete definition of cat must only encompass on its looks, but should also include a complete itemization of its activities. Therefore, a cat's methods might be move, jump, play, breath etc.
Visual Basic programs are built around events. Events are various things that can happen in a program. Let us consider a TextBox control and a few of its associated events to understand the concept of event driven programming. The TextBox control supports various events such as Change, Click, MouseMove and many more that will be listed in the Properties dropdown list in the code window for the TextBox control. We will look into a few of them as given below.
* The code entered in the Change event fires when there is a change in the contents of the TextBox
* The Click event fires when the TextBox control is clicked.
* The MouseMove event fires when the mouse is moved over the TextBox

10. Union is used for _____________ ?
Solution:
To unite the different ranges depending on the logic. It is similar to set union, here range works as set. For eg. Set nrange = Union(rng1,rng2)

Click here to see more Excel VBA Macros Interview Questions