Sunday, November 24, 2013

Creation folder path using macro

Hi fellows

This is another vba which you can find similar coding through googles. Below is how I do it from excel.

1.  Let's say you want to create many folders in this folder below in C:\dummy\

e.g. folder a, folder b, folder c.

2.  In your excel key in the following as shown below:


In cell B2 type: C:\dummy

In cell E1 onwards, type
a, b, c

3. this vba only works 3 times. You can change the number of times by changing the numbers under for loop

Sub test()

Dim abcfolder As String
Dim path As String



path = Cells(2, 2).Value

On Error Resume Next
MkDir path
On Error GoTo 0





For i = 1 To 3

abcfolder = Cells(i, 5).Value



MkDir path & "\" & abcfolder

Next i

End Sub

4. Then the folders are created.

Sunday, November 17, 2013

MAC Or Windows with "Parallels"

Hi fellows

If you use mac, you may want to switch to use Microsoft Windows Excel like me as I am not familiar with Mac Excel. Plus, some formula cannot be recognized in Mac version. Plus, you just want to use Excel with no other software and you have a software called "Parallels"

You can do it this way.

1. Open Parallels and select windows to start

2. Select it in a non-full screen mode. Full screen does not work in this way.

3. Open your Excel

4. In the "Parallels" icon, right click and select "Enter Coherence"

5. Once it is successful, a window will pop up as shown.


6. Now you use your Excel like in your Mac.

7. If you want to open other programs, just right on your top right hand corner button with "||" symbol. Windows Start Menu will be opened for use.



For your further information / reference:

Enter Modality: Enter in a windows fixed screen size
Enter full screen: it will go to full screen mode. To change to other workspace, you can press "Ctrl + left arrow / right arrow"


Tuesday, November 12, 2013

Excel Tips VBA tools Unprotect worksheet through VBA

Hi

I have been busy with moving from Singapore to Hong Kong and Hong Kong to Singapore. Now, I am back to Hong Kong and have some time to talk about IT stuff.....

This is a VBA code in excel which most people would use for "cracking" their own excel. You may forgot the password of your created in your excel spreadsheet, but you can use these codes to crack. You can find these codes in other websites. By the way, you can find these codes anywhere.

1. Use a new excel book and press "ALT +F11". Insert a new module

2. Paste these codes

Public Sub Password_unprotect()
Dim intPress As Integer
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
Dim wbsh, tmstrt, attmpt
tmstrt = Timer
attmpt = 0
On Error Resume Next
Set wbsh = ActiveWorkbook.ActiveSheet
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
attmpt = attmpt + 1
wbsh.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
DoEvents
If wbsh.ProtectContents = False Then
MsgBox "Match found" & "Sheet is now unprotected."

End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub

3. Here is an example.

Let's say you have a worksheet that is protected.

Step 1: Make another worksheet (CTRL +N) called Book 2

Step 2: Press ALT + F11 to go vba code

Step 3: Select "insert" and then "Module"




Step 4: Place the code in your new module


Step 5: Go to your worksheet that is protected (Book1.xls). Just click the worksheet.

Step 6:  Go to visual basic screen and press run.

Step 7: Ok now your worksheet (book1.xls) is unprotected now.


Just a kindly reminder. Please use this legally and you use it for your own use. :D

Wednesday, August 24, 2011

How to become a root user in Ubuntu

I have not blogged for a long time.

I am stuck in office in these days for my new career.

I guess people rarely use Ubuntu unless your PC is very slow and still want to use it or you want to make your PC becoming a server and earn some money from it like website storage.

Recently, I updated my ubuntu to 11.04. This is quite good. It is different design and template to use.

Anyway, I have just learnt how to become a root user in using terminal.

You can directly click to terminal or just press Alt+F2. The “Run Application” dialog will pop up.

Type Gnome-terminal (Enter) and then type sudo gnome-terminal (Enter).

You will be a root user for the terminal in this moment.

You can drag the program you want to install from there.




Thursday, January 27, 2011

What do you think about the flooding in Australia?

This is just my personal view. It is not related to any numerical calculation nor computational programming and insurance products advertisement.

The following is quoted from SMH.com.au
http://www.smh.com.au/business/plea-to-broaden-scope-of-business-flood-relief-20110126-1a5ch.html

Plea to broaden scope

of business flood relief


BUSINESSES in Queensland that are too big to access flood-relief assistance are in danger of going under, says the state's Chamber of Commerce and Industry....

The AIG contacted more than 200 of its members in affected areas and more than 40 per cent of them were inundated. More than half of these would be closed for more than a month. Ms Ridout said she would like to see some of the eligibility for low-interest loans widened to include medium-sized businesses.

The federal opposition’s small-business spokesman, Bruce Billson, said grants were confusing for many small to medium-sized enterprises. ‘‘The government has asked insurers to show compassion and commonsense. Now it’s time for the government to adopt its own advice.’

......
I guess most people would think about disaster insurance/ catastrophe insurance.

Let's think about what would the insurer do then.

I have few for thoughts for this.

1. AIG think about reinsurance. I guess the AIG group would most probably do as the cost is a lot.

2. Will they earn a profit? That's the problem. I guess they barely hit the profit. Most residents would never think that they would face flooding in their life time. Hence, they won't think about water insurance. Instead, they would think about fire insurance due to the trauma of fire blaze few years back.

3. Life insurance does not cover the loss of them. I guess the government would launch some ad-hoc solution to relieve the pain of people there. (I hope. Aussies sometimes are lay back) What could people do then if they have nothing? Theft occurs. So other kinds of insurance would take into effect as well such as household insurance.

4. Risk of default? Who would think about this? Will people claim a lot? I am not sure. I am green here. Let's see what will the Australia government do.

Sunday, December 26, 2010

Merry Christmas Few Tips on Ubuntu Crash & Rescue GRUB

Hi. Wish you all had a nice holiday. I have been studying actuarial control cycle with limited time besides working.


The stock market in Hong Kong is fluctuating a lot these days like our mood of holiday.


Hope you all had an enjoyable weekend.


These are tips I got from the internet and I searched it for myself as well.


1. "Freeze" Screen


This is the most common one. Perhaps, my computer does not like linux system.


Here are some handy tips.


     i.) Quit a program if you can still use your mouse and keyboard
This is similar to when you use windows. You press "CTRL+ALT+DELETE" to end a process


In Ubuntu, you can go to System-> Administration -> System Monitor.



Select the program that you to end and select ‘End Process‘. If it does not work, right click on the application and select ‘Kill Process‘.




However, if you think this is tedious. You can place a short cut of "Force quit" in your bar.
Right click and then select "Add to panel" 

     ii. Control +Alt+ Backspace
This is what I usually do. If you Ubuntu crash, press Ctrl + Alt + Backspace‘. This will quit all programs forcefully and you will be returned to logout screen.

If this works, you can login again.

     iii. Alt + SysRq (With Fn key if possible)+ K
Please be noted that SysRq is under PrtSysRq button.

Similar to 2, it will log you out.

    iv. Alt + SysRq + ‘R’ ‘E’ ‘I’ ‘S’ ‘U’ ‘B’ (In correct order)
The system will process a series of tasks automatically and then reboot itself. Time consumption is a lot for this one.

It is recommended you do this one if there is no other choices.


2. Rescue GRUB
I guess some of you may sometimes incorrectly setup GRUB (Maybe you are using windows loader as your default loader). There is a crash and you see that your computer cannot be booted to your OS.

Just chill down, put in your live CD (USB or other external storage sources which has Ubuntu) and type these magical words.

sudo update-grub

sudo grub-install /dev/sda

You must type these one by then your computer can be rescued. You can go to your linux again and you can choose to re-install your ubuntu again.

These are what I faced these few weeks.

Hopefully, it could help you a bit.

Again, Merry Christmas and Happy New Year.






Wednesday, December 15, 2010

Ubuntu Flash Problem " adobe-flash plugin is virtual."

I recently installed Ubuntu. It is so called another version of linux. It is self-claimed as the safest and most stable engine.

I am a beginner for this OS. The first thing I got stuck is installation of Flash. I tried to install flash from Adobe. http://get.adobe.com/flashplayer/
However, I got this error - " adobe-flash plugin is virtual."  The program to solve it is at the bottom of this page.

I looked around in the internet. One of the guy said that I installed Ubuntu 64 bit Version. This is very common ( I guess). This bug is listed with links to a few solutions https://bugs.launchpad.net/ubuntu/+s...rl/+bug/554449

If you are facing the same problem as me, you can check out whether you have installed 64 bit version.

1.Checking 64 bit OS?
Applications -> Accessories->Terminal

Type uname -a

If the the last few words as "Linux ubuntu 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UTC 2010 x86_64 GNU/Linux"

This shows that you could use the following solutions.

2. Installaion

There are many ways as what I said. You could try install it through the update manager. Or you could directly download a program from a blog which is made by LovingLinux.
Link: http://flash-aid-extension.blogspot.com/

or
https://addons.mozilla.org/en-US/firefox/addon/161939/

It works for me.

Good luck.