Resize Merged Excel Cells – VBA

Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range
With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
¬†¬†¬†¬†¬†¬†¬†¬† MrgeWdth = MrgeWdth + cc.ColumnWidth
Application.ScreenUpdating = False
¬†¬†¬†¬† ma.MergeCells = False
¬†¬†¬†¬†¬† c.ColumnWidth = MrgeWdth
¬†¬†¬†¬†¬†¬† c.EntireRow.AutoFit
¬†¬†¬†¬†¬†¬†¬† NewRwHt = c.RowHeight
¬†¬†¬†¬†¬†¬† c.ColumnWidth = cWdth
¬†¬†¬†¬† ma.MergeCells = True
¬†¬†¬† ma.RowHeight = NewRwHt
¬†¬† cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With

Remote desktop connection shortcut

The Windows Remote Desktop is a built-in tool that lets you take control of a computer¬†over a network connection. It is useful for accessing computers that are not sitting in front of you, and it‚Äôs something that I use quite frequently.

I‚Äôm typically connecting to several computers every day using Remote Desktop, and it finally dawned on me that there had to be a better way to do it than pulling up the application¬†every time.

The first thing you‚Äôll want to do is create a new shortcut, which can be done by right-clicking on the desktop and selecting New -> Shortcut. Then you‚Äôll be entering in something like this:

mstsc.exe /v: /w:800 /h:600

mstsc.exe /v:hostname/w:1280/h:1024

Here‚Äôs what the various portions of that mean:

  • mstsc.exe ‚Äì this is the name of the Remote Desktop application, and is required for the shortcut to work properly.
  • ‚Äì this is the name or IP address of the computer you want to connect to.
  • 800 ‚Äì this is the resolution width for the computer that you‚Äôre connecting to.
  • 600 ‚Äì this is the resolution height for the computer that you‚Äôre connecting to.

With this information you‚Äôre able to create shortcuts for all of the computers you connect to, and when you execute the shortcut it will immediately begin connecting to the computer specified. This can definitely shave precious seconds off of the time it takes to launch Remote Desktop!

Calculating PUE

Power Usage Effectiveness (PUE)

Power Usage Effectiveness (PUE) is a standard developed by The Green Grid‚Ñ¢ consortium to provide a clear answer to the primary issue surrounding energy efficiency within the data center which is how much power is devoted to driving the actual computing/IT components (servers, for example) versus the ancillary support elements such as cooling and lighting. With the rise of computing demands and high density computational environments, the power distribution expressed by either metric is extremely important. The components of the PUE calculation look at the relationship between “Total Facility Power” (TFP) and “IT Equipment Power” (IEP). TFP is measured at the utility meter for the data center space and includes all of the components required to support the IT load including:

  • Power components including UPS systems and PDUs
  • Cooling elements such as CRACs and chillers
  • Other infrastructure components such as lighting

As might be expected, IEP, or more simply, IT Load, is the sum total of the power used by the facility‚Äôs computing components including servers, storage devices and networking equipment. The main difference between these two standards is the placement of each of these elements in their equations and their resulting output.

Calculating PUE

To calculate a facility‚Äôs PUE simply divide the Total Facility Power by its IT Equipment Power. Your answer will be a whole number. For example, a PUE score of 3 indicates that the data center demand is three times greater than the energy necessary to power the IT equipment.

Interpreting PUE

The PUE can range from 1 to infinity. In the case of the PUE, data center energy efficiency increases the closer the number comes to one which indicates that a greater portion of the power required by the facility is used to drive the IT equipment.

Get Parent PID

my $parent_id = getppid();

print "$parent_id\n";


getppid – get parent process ID




Returns the process id of the parent process.


