for odd columns:
=SUM(IF(MOD(COLUMN(A1:D1),2)=1,A1:D1))
for even columns
=SUM(IF(MOD(COLUMN(A1:D1),2)=0,A1:D1))
entered as an array formula CTRL+SHIFT+ENTER
VBScript code to print using notepad:
Dim objFSO, objText, strText, strFile, objShell
strFile=replace(WScript.ScriptFullName,WScript.ScriptName,"to_print.txt")
strText="Test" 'message that should be printed
Set objShell=WScript.CreateObject("WScript.shell")
Set...
the code below assumes you have a check box called "Check Box 1" in "Sheet1" and hides rows 11 to 44 based on its value. You can create a Sub for each checkbox by right clicking on it, selecting "Assign Macro", then select "New".
Sub CheckBox1_Click()
Application.ScreenUpdating = False
Dim...
If you are calculating percentage of target achieved, then the target has to be larger than the actual number and both should be positive. For this the formula is:
=(Actual/Target)*100
If you have negative numbers, you can only calculate percentage change from actual to target. For this a...
Not sure if the code below helps but it's one way of doing it. In the Workbook_Open event put a call to HideSheets to run the macro when the workbook is opened.
Sub HideSheets()
Dim choice As Integer
Dim strList As String
Dim ws As Worksheet
Do Until choice > 0 And choice < 6...
Try this for making up the list:
Sub MakeList()
Dim ws As Worksheet
Dim r As Integer
Dim c As Integer
Dim strRange As String
r = 1
c = 12
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Summary" Then
r = r + 1
Worksheets("Summary").Cells(r, c) = ws.Range("C5")
End...
To skip C5 if it's empty, change this line:
If ws.Range("C5") <> "<>" Then
to:
If ws.Range("C5") <> "<>" and ws.Range("C5") <> "" Then
=LARGE((IF(A:A=D1,B:B)),1)-LARGE((IF(A:A=D1,B:B)),2)
the formula assumes all the unique ids are in column A, the dates are in column B and the unique id you are searching for is in D1
Should be entered as an array formula Ctrl+Shift+Enter
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myRange As Range
Dim lastActive As Range
Set myRange = Range("A1:Z100")
Set lastActive = Target.Previous
If Target.Previous.Column <= 25 And Target.Previous.Column >= 5 Then
If...