Thursday, April 28, 2016

Get FileName list form a Folder in EXCEL

The code below retrieves the file in this directory and creates a list of their names and paths:

Sub GetFileNameList()

Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer

'Create an instance of the FileSystemObject
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Get the folder object
Set objFolder = objFSO.GetFolder("C:\TMP")

i = 1
'loops through each file in the directory and prints their names and path

For Each objFile In objFolder.Files

    'print file name
    Cells(i + 1, 1) = objFile.Name

    'print file path
    Cells(i + 1, 2) = objFile.path
    i = i + 1

Next objFile

End Sub

Friday, April 8, 2016

Get alternating row colors, using conditional formatting in Excel

I got a questing about how to set alternative color in excel sheet when not using table.

Steps:
1) Select the rows you want alternate color
2) go to Conditional Formatting and create New Rule
3) Select "Use a Formula to determine which cells to format" from rule type
4) Put "=(MOD(ROW(), 2)=0)" without quotes in the formula values
5) Click Format button, and apply format required and that's all..

Wednesday, April 6, 2016

How to Test a Database Connection String using NotePad

Create and Configure a Universal Data Link (.udl) File with Notepad.

I just came across a way to test a data provider’s connection string (like a SQL Server database) with the help of a plain text file using Notepad.  To investigate and test out if your connection string works, you’re going to want to create a UDL file. 

To do this, follow these steps:
1.Open up Notepad and create an empty text file, then click File -> click Save -> and save it with the File name: TestConnection.udl to your desktop.
2.Go to your desktop and double-click on the TestConnection.udl file you just created and the Data Link Properties box will popup.
3.Select the Provider tab and Find the provider that you want to connect with and click Next >>
4.Now from the Connection tab, select or enter your source/ server name  then enter information to log on to server -> and select the database on the server. 
5.Click Test Connection and click OK to save the file.

Note: If errors occur during testing of your connection string, you will get a popup box with the error message.

Once, you've successfully tested your connection string, now go and compare the details of your TestConnection.udl with your (website) project connection string to see if they are similar.



Wednesday, March 16, 2016

'Positives in Negatives'


 
A young woman was sitting at her dining table, worried about taxes to be paid, house-work to be done and to top it all, her extended family was coming over for festival lunch the next day. She was not feeling very thankful at that time. 

As she turned her gaze sideways, she noticed her young daughter scribbling furiously into her notebook. 

“My teacher asked us to write a paragraph on “Negative Thanks giving” for homework today.” 
said the daughter.

“She asked us to write down things that we are thankful for, things that make us feel not so good in the beginning, but turn out to be good after all.” 

With curiosity, the mother peeked into the book. This is what her daughter wrote: 

“I’m thankful for Final Exams, because that means school is almost over. 

I’m thankful for bad-tasting medicine, because it helps me feel better. 

I’m thankful for waking up to alarm clocks, because it means I’m still alive.” 

It then dawned on the mother, that she had a lot of things to be thankful for! 

She thought again… 

She had to pay taxes but that meant she was fortunate to be employed. 

She had house-work to do but that meant she had a shelter to live in. 

She had to cook for her many family members for lunch but that meant she had a family with whom she could celebrate. 

Moral:
We generally complain about the negative things in life but we fail to look at the positive side of it. 

What is the positive in your negatives? Look at the better part of life today and make ur everyday a great day. 

Be happy and blessed always.


By :- Anonymous

Thursday, March 10, 2016

Count the number of spaces of text string in Excel


Simple to calculate the number of spaces of text string in EXCEL with following formula:

=LEN(A1) - LEN(Substiture(A1," ",""))

Above formula will count all the spaces in the text.


Count the number of leading spaces of text string with formula

=FIND(LEFT(TRIM(A2),1),A2)-1

Wednesday, March 2, 2016

10 Steps to Dealing With The Negative People in Your Life

Following contents were received in one of my email from friends, all credits goes to the person who wrote wonderful thing. Read the steps and move away negativity. 


We sensitive folks feel things deeply. Especially the negative energy of other people around us. When it’s good, that’s great no problem! But when it is confused, disjointed, cruel, or anything dark, heavy or negative in any way, this has the potential to tip us in a direction we don’t want to go. We have the weight of the world on our shoulders.


"If you don't like something, change it. If you can't change it, change the way you think about it."
You may be in daily interaction with negative people, be they friends, family members, a romantic partner or colleague. You love them, you care about them, you can't just cut them out of your life, but they are negative and their negativity is eating away at you. What can you do?

The best way of dealing with life's challenges is to take a good look at ourselves and take responsibility for what we think, feel and do.

Never give your power away by blaming others for what you have or don't have, what you feel or don't feel. Once you do so, you'll become a victim of circumstance, and instead of using your time and energy to beat life's challenges, you'll sink to a dark and miserable place.

Here are 10 smart, positive and effective ways of dealing with the negativity of the people close to you:

1. Give up the need to complain

Make sure you are taking responsibility for your feelings and mood. Don't go complaining that other people's negativity is affecting you, because it will only create more negativity. Take responsibility for your thoughts and feelings and see what you can do to make yourself feel better and change the existing situation.
"Whoever has limited knowledge of human nature and seeks happiness by changing everything but his own attitude, will waste his life in futile efforts."
Samuel Johnson.

2. Similarity Attracts

Good brings about good, bad brings about bad, and if we want to or not, we pull into our lives events, situations and people that reflect our internal state. Ask yourself: "How am I feeling? Am I happy, excited, thankful and calm? Or am I anxious, frustrated and judgmental?"
You may find that you radiate misery to the environment and that part of the negative energy surrounding you is in fact a reflection of yourself.

3. Don't believe everything you think

This is definitely one of the hardest things to learn. Look closely at the negative people in your life. What is it about them that gets you going? What affects you so much? Is what they are doing really that bad or is your brain playing games with you?
Remember, the brain is configured to look for trouble, and it focuses on other's negative qualities. It'll be very hard to get it to see the positive side of things, but it doesn't mean it's not there.

4. Focus

Ask yourself: "Am I ready to find the good in these people? Am I able to see their good qualities?" Let the answers come naturally, make sure you are being honest with yourself.
If you feel like you're insistent and won't change the way you are looking at people and situations, don't give yoursef a hard time. This takes time and patience, and when you are ready, you'll make this step. Remember, we all have good in us.
"It's so hard when I NEED to do it and so easy when I WANT to do it." -Annie Gottlier.

5. Don't make their problems YOUR problems

For their sake and yours, make sure you are not adopting their problems and becoming negative about them yourself. If you want to cure negativity, sliding down right along with the negative person won't help, it will just make it worse by validating their thought and behavioral patterns. Rather, focus on solutions, not problems. Offer that and nothing else.

6. Taking ownership

Instead of being a victim and judge, blame and pass criticism, you need to take full responsibility for your thoughts and feelings, and take a different approach.
"Everything that annoys us in others can lead us to a better understanding of ourselves."
Carl Jung.
Don't waste your time obsessing and thinking: "They are ruining my energy, making me miserable, their negative energy is infecting my own..." Instead, say to yourselves: "How can I use this for my advantage? Is there something I'm doing wrong? How can I improve the situation and increase my positive energy to be stronger than their negative energy? What do I learn from all of this?"

7. Come with your own positive energy

Focusing on negative energy cannot create positive energy, and the other way around is also true. Focus on making yourself happy enough that you have great positive energy, and you will see the negativity cringing away from it.
Remember, energy is contagious!
How to put up positive energy? Focus on the things you like about the negative people, focus on things you love about yourselves, life and the world around you. Think of loved ones, of things that make you happy. That way, you will increase the positive energy exponentially.
If you incur negative energy by thinking about bad things, the opposite is also true, and you'll be able to hopefully 'wake up' your fellow workers. You can't focus on them both at the same time, so choose - happiness or misery.

8. Be part of the change you'd like to see

The world is no more than a reflection of who we are, deep inside. Try to go for a feeling of well-being, to live a positive life, a merry life, that has love, trust, and the pursuit of happiness. We cannot change others, but only ourselves. This is the only way to change the world.
Think of it this way: When you are happy, the world seems happy, and the sky is open and blue. When you are sad, the world seems sad as well, and the sky is grey and uncaring, leaving you alone to deal with your pain.
Flow with life events, don't resist them, live in harmony and be the change you wish to see in the world.
"Never underestimate your power to change yourself. Never overestimate your power to change others." - Wayne W. Dyer.

9. Awareness and acceptance

Work on understanding life's inevitable duality - accept the negative with the good. Don't harp on people's negativity, don't judge or fight them. Let them be, look and accept. Remember, your world is no more real than a reflection of who you are, deep inside. Don't try to bring everyone into your own world, accept theirs as no less real than yours, and their point of view as no less valid.
The hardest part of acceptance is accepting that, sometimes, some people cannot be changed. Their negativity is something they will defend to the last drop. Not because it gives them pleasure, but because they think it is a natural part of themselves. Even though it's never too late to try and change that point of view, some never will. It is up to you to either accept their negativity and react accordingly, or take your distance from them. This is especially hard when it is someone we love.
"Knowing your own darkness is the best method for dealing with the darkness of others."
Carl Jung.

10. Move forward

Dealing with negativity and trying your best to disspell it can be exhusting, and at some point you have to move on with your life in a positive way. Find a path that allows you to go on with your life without the negativity of others, but also without the regret that leaving a loved one or friend behind may cause you.

Make your feelings known to them, make them understand they are hard to be around, and slowly decrease your contact. If they want you to stay in their lives, they will be forced to at least pretend to be less negative, and pretending is the first step to actually becoming less negative. The more we act a certain way, the more we believe in it.

Tuesday, March 1, 2016

Turn Off Autorun or Autoplay on Windows system



Mostly Virus easily spreading using removable media such as CD, USB, etc. Some people maybe still didn't know how to turn off autorun or autoplay in Windows.

Step-by-Step about How to Turn Off Autorun/Autoplay on Windows:

1. Open Run Tasks (Click here to view the shortcut to launch Run)

2. Type : gpedit.msc (case insensitive)

3. Click Computer Configuration –> Administrative Templates –> Windows Components –> Autoplay Policies –> Double click the Turn off Autoplay at the right side window. 

4. There are 3 configurations available : 
Not Configured
Enabled
Disabled

5. Choose Enabled then click apply.