- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad 1
Copy following code and paste in a userform module to add form resizer.
Original Source: Andy Pope
|
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad 1
Copy following code and paste in a userform module to add form resizer.
Original Source: Andy Pope
|
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad1
I was trying to see if text sorting can be done with the help of worksheet formula. I tried and I think I am successful to some extent. Sorting text is such a day to day activity, it surprises me why Microsoft hasn’t provided a worksheet formula for doing it.
I know that you always had a choice of autofilter but it requires manual steps. While trying to wrok with countif() formula, I came across with following worksheet array formula which sorts the array. “myArray” is the name of the array this worksheet formula would sort. Please remember, you need to use it as an array formula, i.e., select the whole area where you want the output, and then type your formula and while entering please hold on to ctrl+shift and then press enter.
=INDEX(myarray,MATCH(SMALL(COUNTIF(myarray,”<=”&myarray),ROW(myarray)-ROW(INDEX(myarray,ROWS(myarray),0))+ROWS(myarray)),COUNTIF(myarray,”<=”&myarray),0),0)
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad1
Today someone asked me how to display a formula in a cell. What a silly question? It’s Easy, just enter an apostrophe (‘) in front of the formula and one can see the formula. Oh No! But if you don’t want to disturb the cell where the formula resides? Oh! So you want to show the result of the formula as well… Yes! at the same time a user should be able to see the formula as it is in a different cell. Isn’t it simple? Enter into the cell, copy the formula starting “=” and till the end and paste it in a different cell and add apostrophe in front of it. But what if, you have thousands of formula to show? Now, there is something to work on…. Let me share what i tried sometime back and i think this should work!
Open a new Excel Workbook, press alt+F11, if you dont see a small window with the names of the sheets in a workbook, click ctrl+R… Now you will be able to see a window with all the workbooks and its contents like sheets, userforms, & codemodules. Right click the new workbook project and choose insert –> module… Now double click the module that has just been inserted… Do you see code window? If you are not, press F7 key and you will see the code module. Now in this module, copy the following code and paste it.
|
Now, you are ready to show the user the formula as it is wherever you want. just type "=showformula(" and then the reference to a cell to display the formula of that particular cell.
eg., =showformula(e6)
To download an example workbook, CLICK HERE
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad
The following code, I found at www.eng-tips.com, is the process to create a UserForm dynamically using a macro in VBA.
|
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad
|
The following code will creqate log entry each time a workbook is opened.
|
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad
The following code will help you export a selected chart as an image and will be saved in the same folder as the workbook. |
Copy the following code and paste it in a code module
|
- Selva V Pasupathy, HSBC Global Resourcing, Hyderabad
ActiveSheet.Shapes.AddTextEffect(PresetTextEffect:=2, _
Text:="DRAFT", FontName:="Arial Black", FontSize:=36, _
FontBold:=False, FontItalic:=False, Left:=50, Top:=150).Select
With Selection.ShapeRange
.ScaleHeight 1.23, False
.ScaleWidth 1.6, False
' Solid or no color
.Fill.Visible = False ' Hide any colors
.Fill.Transparency = 0.5 ' semi-transparent
' Outline
.Line.Weight = 0.75 ' Line weight outline (1.25 is darker)
.Line.DashStyle = 1 ' Use a solid line
.Line.Style = 1 ' use continuous, I am guessing
.Line.Transparency = 0# ' Make the line semi-transparent
.Line.Visible = True ' show the line
.Line.ForeColor.SchemeColor = 12 ' line color is blue
.Line.BackColor.RGB = RGB(255, 255, 255)
.Height = 80 ' expand the height of the text
.Width = 400 ' expand the width of the text
End With