Skip to content

Instantly share code, notes, and snippets.

View dhruva81's full-sized avatar
🏠
Working from home

Dhruva dhruva81

🏠
Working from home
View GitHub Profile
By default, Excel provides the Conditional Formatting feature for us to complete this problem, please do as follows:
1. Select the data range that you want to highlight every nth row.
2. Click Home > Conditional Formatting > New Rule, see screenshot:
3. In the New Formatting Rule dialog box, click Use a formula to determine which cells to format option from the Select a Rule Type: list box, and then type this formula =MOD(ROW(),8)=0 into the Format value where this formula is true text box,
Tips: with above formula, you can highlight every fourth row in the range, you can change the number 4 to 3, 5, 6…for your need.
4. After entering the formula, then please click Format button to go to the Format Cells dialog, choose one color you like under the Fill tab.
If you want to highlight every nth column, please apply this formula: =MOD(COLUMN(), n)=0.
If you want to highlight every nth row, please apply this formula: =MOD(ROW(), n)=0.
@dhruva81
dhruva81 / ShareX code to upload cropped images on server
Last active February 4, 2019 03:46
ShareX code to upload cropped images on server
<?php
$secret_key = "9ge9ag99135213tgedavxgfedsaxeg"; //Set this as your secret key, to prevent others uploading to your server.
$sharexdir = "yoyo/"; //This is your file dir, also the link..
$domain_url = 'http://website.com/';
$lengthofstring = 5; //Length of the file name
function RandomString($length) {
$keys = array_merge(range(0,9), range('a', 'z'));
@dhruva81
dhruva81 / Insert a New Row at Top or Bottom of Tables in MS Word using VBA
Last active February 4, 2019 03:47
Insert a New Row at Top/Bottom of Tables in MS Word using VBA
Sub insertTopRow()
Dim theTable As Table
Dim theNewRow As Row
Dim i As Integer
For i = 1 to ActiveDocument.Tables.Count
Set theTable = ActiveDocument.Tables(i)
Set theNewRow = theTable.Rows.Add(theTable.Rows.First)
'Other row formatting
Next i