Sunday, August 6, 2023

Repeat Rows At Excel Bottom using VBA

 Sub repeatBotRows()


Dim botRows As Range, botCount As Long

Dim firstPgBk As Long, LasRow As Long

Dim totPages As Long, n As Long, m As Long


Application.ScreenUpdating = False

Application.DisplayAlerts = False

Application.Calculation = xlCalculationManual


Set botRows = Range("2:7")

Sheets("Sheet1").Copy after:=Sheets("Sheets1")

ActiveSheet.Name = "printOrig"

With ActiveSheet.PageSetup

.PrintTitleRows = "$1:$1"

End With

firstPgBk = ActiveSheet.HPageBreaks(1).Location.Row - 1

botCount = botRows.Rows.Count

LasRow = Cells.Find("*", [a1], , , xlByRows, xlPrevious).Row

totPages = Application.Ceiling(LasRow / (firstPgBk - botCount - 1), 1)

Range(Rows(firstPgBk - botCount + 1), Rows(firstPgBk)).Select

Selection.EntireRow.Insert Shift:=xlDown

botRows.Copy Range("A" & firstPgBk - botCount + 1)


n = 2

m = 0

Do

Range(Rows(firstPgBk * n - botCount - m), Rows(firstPgBk * n - m - 1)).Select

Selection.EntireRow.Insert Shift:=xlDown

botRows.Copy Range("A" & firstPgBk * n - botCount - m)

n = n + 1

m = m + 1

Loop Until n > totPages

Application.Calculation = xlCalculationAutomatic

' ActiveSheet.PrintOut

' ActiveSheet.Delete

ActiveSheet.Buttons.Delete

Application.DisplayAlerts = True

End Sub


Repeat excel rows at bottom

 Sub MyFooter()

Dim xTxt As String

Dim xAddress As String

Dim xRg As Range

Dim xCell As Range

On Error Resume Next

xAddress = ActiveWindow.RangeSelection.Address

Set xRg  = Application.InputBox("Select the row you will insert repeatedly at the bottom:", "Kutools for Excel", xAddress, , , , , 8)

If xRg Is Nothing Then Exit Sub

For Each xCell In xRg

xTxt = xTxt & xCell.Value & " "

Next

ActiveSheet.PageSetup.LeftFooter = xTxt

End Sub

Friday, July 28, 2023

Repeating Rows at the bottom of each printed excel sheet using VBA

 Sub MyFooter()

Dim StrFtr As String, Rng As Range, Sh As Worksheet, c As Range

Set Sh = Worksheets("Sheet5")

Set Rng = Sh.Range("A55:G55")


For Each c In Rng

StrFtr = StrFtr & c & " "

Next c


ActiveSheet.PageSetup.LeftFooter = StrFtr

End Sub

Hide rows in excel based on cell value using VBA

Sub HideRow()
LineStart = 2
LineEnd = 16
ColumnNumber = 2
For i = LineStart To LineEnd
If Cells(i, ColumnNumber).Value <> "YourCellValue" Then
Cells(i, ColumnNumber).EntireRow.Hidden = True
Else
Cells(i, ColumnNumber).EntireRow.Hidden = False
End If
Next i
End Sub

Tuesday, June 20, 2023

How to Setup Web Hosting platform with CWP

hostnamectl set-hostname my.new-hostname.server

sudo vim /etc/hosts

Installer for CentOS 7:


cd /usr/local/src
wget http://centos-webpanel.com/cwp-el7-latest 
sh cwp-el7-latest

Installer for CentOS 8, Alma Linux and Rocky Linux:

cd /usr/local/src 
wget http://centos-webpanel.com/cwp-el8-latest 
sh cwp-el8-latest


Optional Installer Arguments

Available long name arguments
–restart yes (for automatic restart after successfull install)
–phpfpm [5.3|5.4|5.5|5.6|7.0|7.1|7.2|7.3|7.4] (you can use only one)
–softaculous yes (install softaculous – script installer)

Available short name arguments
-r yes (for automatic restart after successfull install)
-p [5.3|5.4|5.5|5.6|7.0|7.1|7.2|7.3|7.4] (you can use only one)
-s yes (install softaculous – script installer)

Example for centos 7 (you can combine short and long name arguments)
sh cwp-el7-latest -r yes --phpfpm 7.3 --softaculous yes

Any of this additionals can be also installed later from cwp gui.

Reboot Server:

Reboot your server so that all updates can take effect and CWP gets started.
reboot

Cloud Linux Installer:

You need to have CloudLinux License.
wget //repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
sh cldeploy -k YOUR-KEY
cd /usr/local/src/
wget //dl1.centos-webpanel.com/files/c_scripts/cloudlinux.sh
sh cloudlinux.sh


After CloudLinux installer is done it will automatically reboot the server!!
After reboot, you need to build CageFS and enable it:

/usr/sbin/cagefsctl --init
cagefsctl --enable-all




Log in to your CWP server using the link provided by the installer on your server.

Control WebPanel Admin GUI at http://SERVER-IP:2030/
Username: root
Password: YOUR_ROOT_PASSWORDSetup root email
Setup at least one hosting package

Or edit default package.
Setup shared IP

Must be your public IP address.
Setup nameservers


And now you are ready to host domains.

For additional configuration instruction, please check our wiki/documentation site:

Office 2021 Activation using command

  @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================...