Showing latest added snippets.

HTML 4.01 Transitional - Snippet icon HTML 4.01 Transitional
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: MarkHogan
Java Starter - Snippet icon Java Starter
  1. class HelloWorld {
  2. public static void main(String args[]) {
  3. System.out.print("Hello World");
  4. }
  5. }
See the complete snippet
Language: Java
Tags:
Submitted By: MarkHogan
PHP Starter - Snippet icon PHP Starter
  1. <?php
  2. print "Hello World";
  3. ?>
See the complete snippet
Language: PHP
Tags:
Submitted By: MarkHogan
Objective-C Starter - Snippet icon Objective-C Starter
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main (int argc, const char * argv[]) {
  4. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  5.  
  6. NSLog(@"Hello World");
  7. [pool release];
  8. return 0;
  9. }
See the complete snippet
Language: Objective-C
Tags:
Submitted By: MarkHogan
Untitled Snippet - Snippet icon Untitled Snippet
  1. Option Explicit
  2.  
  3. '#1
  4. 'MATCHING ONLY Examples using the TEST method
  5. '********************************************
  6.  
  7. Public Sub Matching_1()
  8. 'declare a RegExp type
  9. Dim Reg As RegExp
  10.  
  11. 'declare other variables
  12. Dim str As String
  13. Dim valid As Boolean
  14.  
  15. 'create a new RegExp object
  16. Set Reg = New RegExp
  17.  
  18. 'set string to be tested
  19. 'str = "John"
  20. str = InputBox
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Untitled Snippet - Snippet icon Untitled Snippet
  1. Option Explicit
  2.  
  3.  
  4. '**************************************************
  5. 'MATCH & EXTRACT Examples using the EXECUTE method
  6. '**************************************************
  7.  
  8. Public Sub Match_and_Extract_1()
  9. 'declare a RegExp type
  10. Dim Reg As RegExp
  11.  
  12. 'declare other variables
  13. Dim strOrg As String, strMatches As Object, strMatch As Object
  14. Dim valid As Boolean
  15.  
  16.  
  17. 'cr
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Matching using Test Method 1 - Snippet icon Matching using Test Method 1
  1. Option Explicit
  2.  
  3. '********************************************
  4. 'MATCHING ONLY Examples using the TEST method
  5. '********************************************
  6.  
  7. Public Sub Matching_1()
  8. 'declare a RegExp type
  9. Dim Reg As RegExp
  10.  
  11. 'declare other variables
  12. Dim str As String
  13. Dim valid As Boolean
  14.  
  15. 'create a new RegExp object
  16. Set Reg = New RegExp
  17.  
  18. 'set string to be t
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Password Creation - Snippet icon Password Creation
  1. Sub Password()
  2. Dim pass1, pass2, userInput, numericCount, midChar As String
  3. Dim isPasswordUnique, isValid As Boolean
  4. Dim passwordCells As Range
  5. Dim pos28 As Integer
  6.  
  7.  
  8. ' Ask for valid password until unique.
  9. Do
  10. ' Ask for password until clears validation.
  11. Do
  12. isValid = True
  13. userInput = InputBox("Please enter a password that meets
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Lab_1 MPG - Snippet icon Lab_1 MPG
  1. Option Explicit
  2.  
  3. Sub TravelExpenses()
  4. 'Declare variables
  5. Dim firstName, lastName, nMiles, milesPerGallon, response, output As String 'Always declare string types for data to be entered from keyboard
  6. Dim avgPrice, tripCost As Currency
  7. Dim isValid As Boolean 'Flag to terminate the DO LOOP
  8.  
  9. 'INPUT SECTION: ***** FIRST NAME ***************************************************
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Do Loop Example Lab2 - Snippet icon Do Loop Example Lab2
  1. Option Explicit
  2.  
  3. ' Do loops can be one of four forms:
  4. '
  5. ' Do Until ...
  6. ' body of loop
  7. ' Loop
  8. '
  9. ' Do While ...
  10. ' body of loop
  11. ' Loop
  12. '
  13. ' Do
  14. ' body of loop
  15. ' Loop Until ...
  16. '
  17. ' Do
  18. ' body of loop
  19. ' Loop While ...
  20. '
  21. ' In each of these, ... stands for a condition, and "body of loop" can be
  22. ' any sequence of statements. In the first two forms, there is a possibility that
  23. ' the body of the loop
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Homework_2 BMI Report - Snippet icon Homework_2 BMI Report
  1. Option Explicit
  2.  
  3. Sub USERBMIREPORT()
  4. 'Declare variables
  5. Dim firstName, lastName, userWeight, userHeightFeet, userHeightInches, weightStatus, response, output As String 'Always declare string types for data to be entered from keyboard
  6. Dim userBMI, totalInches As Double
  7. Dim isValid As Boolean 'Flag to terminate the DO LOOP
  8.  
  9. 'INPUT SECTION: ***** FIRST NAME ****************
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Homework_1 String Variable Concat CRLF - Snippet icon Homework_1 String Variable Concat CRLF
  1. '*******************************************************************
  2. 'PURPOSE: String Variable / Concatenate / Carriage Return & Linefeed
  3. 'AUTHOR: John Stairs
  4. 'DATE: 8/17/2017
  5. '*******************************************************************
  6.  
  7. Sub Greetings()
  8.  
  9. Dim myString As String 'declare a string variable
  10.  
  11. myString = Worksheets("Greetings").Range("A1").Value 'assign Range a1's va
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Total Product Expense Example Lab1 - Snippet icon Total Product Expense Example Lab1
  1. Option Explicit
  2.  
  3. Sub TotalProductExpense()
  4. 'Declare variables
  5. Dim unitCost, totalNum, response, output As String 'Always declare string types for data to be entered from keyboard
  6. Dim totalCost As Currency
  7. Dim isValid As Boolean 'Flag to terminate the DO LOOP
  8.  
  9.  
  10. 'INPUT SECTION: ***** UNIT COST *************************************************************
  11. 'Capture Unit
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Lab_2 - Snippet icon Lab_2
  1. Option Explicit
  2.  
  3. Sub One()
  4.  
  5. ActiveWorkbook.Worksheets("Employee Scores").Range ("A1")
  6. With .Font
  7. Size = 14
  8. Bold = True
  9.  
  10. End Sub
  11.  
  12. Sub Two()
  13.  
  14. ActiveWorkbook.Worksheets("Employee Scores").Range("A3:F3").Font.Bold = True
  15. ActiveWorkbook.Worksheets("Employee Scores").Range("A3:F3").Font.Italic = True
  16. ActiveWorkbook.Worksheets("Employee Scores").Range("A3:F3").HorizontalAlignment = xl
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Homework_3 Password Encyrption Clear - Snippet icon Homework_3 Password Encyrption Clear
  1. Option Explicit
  2. '*************************************************************************************************************
  3. 'Write your solution inside each appropriate and relevant Sub below
  4. 'Use good programming practices as discussed in class: Comments, indentations, ...
  5. 'To run a particular Sub, place the cursor anywhere inside the Sub, and hit the Green Triangle icon at the top
  6. '**********
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Create Dynamic Ranges - Snippet icon Create Dynamic Ranges
  1. Sub CreateNames()
  2. 'http://www.contextures.com/xlNames03.html
  3.  
  4. ' written by Roger Govier, Technology4U
  5. Dim wb As Workbook, ws As Worksheet
  6. Dim lrow As Long, lcol As Long, i As Long
  7. Dim myName As String, Start As String
  8.  
  9. ' set the row number where headings are held as a constant
  10. ' change this to the row number required if not row 1
  11. Const Rowno = 1
  12.  
  13. ' set the Offset as the
See the complete snippet
Language: Other
Tags:
Submitted By: SurfRGeek
Code Collector Pro Header Image

Get Code Collector Pro

Code Collector Pro is a storage app for code snippets. From HTML to Cocoa, C++ to Ruby, Code Collector Pro looks after all your code snippets, letting you quickly reference them whenever you want.

Find out more » Download Code Collector Pro 1.6.4

Web Analytics