Shortcut to Highlight Cells

I started on a role to reconcile accounts and it involved manual reconciliation which could not be automated. Thus I use to check 2 sheets with an account number and if amounts match up in the 2 sheets then would have to highlight it with a color. But being keyboard savy it was a pain in excel to use the mouse and choose a color from the toolbar. Rather I wanted a keyboard shortcut which when pressed will highlight any cell and if pressed again will remove the highlight. After learning a little VBA I was able to make my own shortcut. Below is how I did it:

Open the visual basic editor by hitting ALT+F11 from excel. Create a new module (ALT+I+M) and add the below code.

Sub markcolor()
If Selection.Interior.ColorIndex = 6 Then
Selection.Interior.ColorIndex = 0
Else
Selection.Interior.ColorIndex = 6
End If
End Sub

Now switch back to excel and hit ALT+F8 which should bring the macro dialog box with the macro “markcolor” in the list. Just select it and click on “Options” which prompts to enter an alphabet for shortcut key. I enter the alphabet q in the box. And say Run.

That is it now go back to excel and when you hit CTRL+q the cell gets highlighted with yellow color and if pressed again it removes the color.

Note:

1) This shortcut will only work in the excel workbook where you have added the module. For advance users who want to have it available in the entire excel applications irrespective of any file selected, this code should be written in personal.xlsb file.

2) The color code for yellow is 6. If you need any other color then play around by changing this number.

Attaching the file with the code for reference. Happy Learning

 

 

Sharing Screen or Remote Desktop with ease : Teamviewer & Skype

Collaboration is a common word these days and so are virtual meetings / online trainings. Few years back it was hard to imagine employees working from their home but now with dazzling internet speeds travel to work is now avoidable. I can say internet is doing a great deal to reduce pollution and letting earth stay green.

A friend of mine had trouble installing an application and he needed my help to get it done. But he lives like 30 miles away and I am not that friendly to drive such a distance to help him. But did I disappoint him no ways!! I offered him my help over internet. There are 2 good ways to view/control a remote machine using internet and I used “TEAMVIEWER” on this occassion.

TEAMVIEWER: This is how it was done using teamviewer–

1) Me and my friend has to copy this url and paste it in browser and hit enter:  http://www.teamviewer.com/en/download/windows.aspx    �
2) Then we gotta hit the option which says “Download v7.0.12989″ { Remember v7.0… is the version. It can change after few days}
3) A dialog pops up to save or run the file. We hit run when prompted.
4) This downloads an “.exe” file and once the download is over hit “Run”. Accept the license agreement to launch teamviewer
5) On launch it throws a window with 2 sections a) Allow Remote Control and b) Control Remote Computer.
6) Now my friend gives me the random numbers (“Your Id” and “Password”) which is displayed in the first section ‘Allow Remote Control’. He sends me these details through mail or over phone.
7) I take the id and enter in the 2nd section ‘Control Remote Computer’ and hit ‘Connect to Partner’. It asks me the password and I enter the one which my friend provided. That is it!!

I am then able to see his screen and he can grant me permission to control his screen. I then fix any issues on his pc and install the app he needed thus saving money and environment.

The other option when someone would like to share his screen with others is using SKYPE. Skype is a popular platform to communicate over internet. I think the word skype is now added to Oxford dictionary. Ex: I will skype you tomorrow 9 PM. Anyways the easiest way to share screen while on a call is to clik the ‘+’ symbol on the skype menu bar and select “Share”. This is the best way when you are trying to give a demo of some product/explain something to a colleague or just having a casual talk on skype.

There are many other options which can be tried apart from Teamviewer and Skype like gotomeeting, logmein, webex, livemeeting but Teamviewer and Skype is all I have used since years and never felt the need of other platforms.

Hope you will use these channels and help reduce pollution on Earth.

Keep watching this space for more! Bye till then.

 

Creating Distribution List with VBA Excel

In the last post in Excel Category I talked about text functions and I posted a situation to create a distribution list from list of email ids in a column. There is no formula in excel which you can use to create a distribution list. But good news is that you can create one using VBA. Below is the code which would give a formula in excel to use for distribution list.

There are many ways to get this function written but below is one of the easiest way to understand the code. Paste the below code in any vba module and use it as a normal formula in excel.

********************

Function listcat(src_range As Range, diff As String) As String
‘src_range is range variable to allow range selection and diff is variable to store ‘differentiators
Dim final As String
‘variable called final to store the distribution list
Dim c As Range
For Each c In src_range
final = final & diff & c.Value
Next c
‘finally taking the clean distribution list to listcat
listcat = Right(final, Len(final) – 1)
End Function

*******************

That is it go back to excel and use this like a formula in excel, for ex: =listcat(B2:B9,”;”) where B2:B9 is the list of email ids which needs to be added and “;” is the separator.

Attached is the file for your reference with the code and formula hope you will find it useful.

Note: These days you can directly copy the entire values in the column and paste in outlook/other mail clients which will automatically create a list. But if in situations it doesn’t this is the best way.

 

 

Text functions in Ms-Excel: Left, Find and Concatenate

In the last post on text functions we saw trim and clean. For those whow work with lots of data analysis and specially if the data is coming from various sources he gotta use more than just trim to transform the data into meaningful information. One of the most useful function that I use is “Left”. Suppose you have “UHG212″ in a cell A1 and you need to extract the first 3 characters from the cell in A2 then you use this formula in A2:

=left(a1,3)

This will give you the first 3 characters from left and you can drag this formula to apply it for the entire column. To extract text from right you use the similar one =right(a1,3). Well that was easy but consider this situation you got a list of values like the below in cells B1 and B2 respectively.

EXTT_223

MYTTTY_443

In the above 2 values the text part is a course code and the numeric is its id number so I want to extract only the text part. (Of course you can use text to columns.) so to get this with a formula I need to know what is the position of underscore in each entry. So I know of a formula which would give me that which is =find(“_”,b1,1) which would return 5 for EXTT_23. So now to extract the text part out of it, you mix the left formula and the find which would be like this:

=left(b1,find(“_”,b1,1)-1)

This would give me the answer EXTT and how does that work? The find formula gives me the result 5 and I am substracting one from it to make it 4. Now using left function to get the 4 characters from left.

Just drag the formula to the remaining cells and it would give you the required course codes for each entry.

The data for the same with formulas is in this file (techflames_practice.xlsm), you can download and check it for your reference.

Before I wrap up I would also like to tell little about concatenate with an example. Suppose you’ve got info,@,techflaemes.com in 3 cells a1,b1,c1 respectively and you gotta join them to make the email id info@techflames.com how would you do it? 2 Ways one is using the formula in say cell d1 which is =concatenate(a1,b1,c1) which will give you the result else the direct way would be this formula =a1&b1&c1 which also gives you this result. Ok now I leave with this thought what if you have 100 emails in a1 to a100 cells  and you want to make a distribution list i.e. join them using a coma in between. Are you gonna write a lengthy formula like this =a1&a2&a3&a4…till &a100. Well for such things you got vba which can help you do this quickly. Will post the code in VBA section very soon.

Cya until next post.

UM Player- Really a Universal Media Player

Well there was a time when I used Windows Media Player and then came the powerful and still running high VLC player but I stumbled upon a new Player -UM Player (Universal Media Player). I gotta admit it is a nice one with additional features. It players over 270 different formats. The things which makes it stand apart is its ability to search youtube videos directly from the search bar in the player. Search for a video and just play it directly. Moreover it offers the ability to record a video, just hit the record button adjacent to stop button and you record the video. This would help a lot of my friends who keep asking me how to record videos from youtube. Moreover one functionality I use a lot is the fast forward option. I love cooking videos but couldn’t wait till the onions get brown so I can increase the speed of the video to make it fast.

And if you are a music freak and would like your favorite radio station to play in the background while you work then you just search in the shoutcast search bar for your favorite radio channel and play it on directly from the player. I used to use winamp for this but now I don’t have to have too many things for different purpose.

Other basic features of a normal audio/video players are all there in UM player. I have tried and find this very good hope you will try and like it too. In case you would like to download it here is the link: Umplayer and for any FAQs visit their site: FAQ.

C ya until next post.

Google – Being More Appealing and Interesting.

If you use google a lot then you would have seen few changes which are very impressive. Last year came the live suggestions in the search box where google suggests options even before you type the entire sentence that was awesome and now google is giving you very apt answers for all your search queries:

1)      Like if I want to know the time in New York – all I need to do is type in the search box: “time now in new york” and the first thing that comes is the current local time of newyork city.

2)      If I am a research/analyst pro dealing with numbers and need quick math calculation, I can type the entire query in the search box and I get the result along with a ultra light calculator popping up from the serch result. Ex: I type: 25000*(2+3)*2 and then I get the result of this as 250000 which is very correct. Also I see a calculator which is awesome for further mathematical calculations. I hit the clear button and then I start adding up numbers by choosing from the calculator it’s amazing.

3)      For people interested in stocks no need to browse heavy sites to know the stock quote of your favorite company. If I need the stock quote of “Infosys Technologies”, I just type in the search box: Infosys stock price: and there comes a very good intraday chart showing the ups and downs in the stock today.

4)      For people assessing the property rates usually would like to convert the area into their favorite measuring options. Like I would like to know an area of 200 square yard is how many square foots then I go to google search and type: “how many square feet make one square yard”—Google gives me an answer in a very cute control where I can then check for various other numbers. Like I type 200 in yards and quickly I get the answer in foots that it is equivalent to 1800 square feets.

5)      Check out the answers for temperature and you will be glad to see the results: I type “Hyderabad temperature” And I get good looking picture of today’s temperature with the forecast for next 4 days this is awesome.

6)      And finally the doodles oh I love them and the doodle I saw today on the google page for football is a very nice game. Busy working I opened google.com to search for a news and suddenly saw the doodle in the center. Its awesome, you have a play button and it turns out that it’s a small game. You are the goal keeper and you are up against a striker. That is good piece to relax from work. I scored my highest 21 in 3 attempts. Check out how much you can reach to. BTW if you are looking to access all the doodles from Google then go to the site Google Dooles and you can access many such doodles if you missed them.

 Happy Googling. And comment if there is any other feature of Google Search which has impressed you.

Outlook.com is the New Hotmail

I am an ardent fan of Hotmail since I started emailing. I still like its classy appeal among all other email services. Microsoft has added a cloudy and a retro touch to the most popular email service and now Hotmail can be accessed in a new avatar at Outlook.com.

The look is even more classy and now I see that the screen is filled with only the information which I care. The looks seems weightless and most of the options come when you hover the mouse over any item. And a great integration with skydrive to store a bigger file size still exists. It also allows to view photos in a slick frame and many more stuff..

I recommend outlook.com a try to all the hotmail users as well as any other email service fans.

Remove empty rows from selection using VBA.

Often I come across this situation where I have a few empty cells in between. Like Consider a blank sheet and then you paste some values into it in Column “A”.  Like in A1: January, A2: February, A3,A4&A5 are blanks, then A6: March, A7,A8 are blank, A9: April, A10: May, A11,A12 and A13 are blanks….. and so on…

Imagine this sequence runs down to 80 or 100 rows then its a pain to delete the blank rows in between. A trendy excel user might use the paste special technique of skip blanks and accomplish this. But a more easier way is a single line of code that helps remove all blanks rows. The code goes like this.

sub deleteblanksrows()

Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete

End sub

Now copy this code and paste it in a module (click ALT+F11 to go to vba editor and from Insert menu click Module-then paste this in the blank white space on right).

Go back to excel and select the selection which contains blank rows say in our case above it would be range A1:A13. Go back to VBA editor by hitting ALT+F11 and then keep the cursor on the 2nd line of the code and hit f5 to run the code.

That is it switch back to excel and you will see all the blank rows are gone.

I work with unformatted  data a lot and I use this code quite often so I have placed this on the ribbon of my excel 2010.

Hope you will also benefit from this VBA snippet.