Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default source code for copyright

I have written a program using Excel 2000 and am trying to
get it copyrighted. The Copyright office wants the source
code. How do I get that? Is there a way to print the
formulas that I developed? Thanks
Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default source code for copyright

Here is code somebody else posted in this newsgroup for generating a list of
the formulas in a workbook.

Public Sub doFormula()

Dim bSaved As Boolean
Dim sWS As String

'Displays a list of formulae and named ranges used in
the workbook
Dim wks As Worksheet
Dim bHasFormula As Boolean
Dim i As Integer
Dim Cell As Range

'Switch off screen updating to improve performance
Application.ScreenUpdating = False

'UnprotectWS
With ActiveSheet
'Unprotect and clear the worksheet
.UsedRange.Delete xlShiftUp
bHasFormula = False

Range("A1").Value = "Worksheet"
Range("B1").Value = "Formula"
Range("C1").Value = "Range"
Range("D1").Value = "Protected"
Range("A1:D1").Font.Bold = True

'Check if the workbook contains any formulae
For Each wks In ThisWorkbook.Worksheets
If wks.UsedRange.HasFormula = False Then
Else
bHasFormula = True
Exit For
End If
Next wks

If bHasFormula = False Then

'If false display message in cell C1
.Range("B2").Value = "This Workbook contains
no formulae."
i = 2
Else

'If true build the formulae list
i = 2

'Check each cell on each sheet for formulae
For Each wks In ThisWorkbook.Worksheets
For Each Cell In wks.UsedRange.Cells
If Cell.HasFormula = True Then
'If the cell has a formula record
the worksheet
'name, cell address and cell formula
.Cells(i, 1).Value = wks.Name
.Cells(i, 2).Value = "'" &
Cell.Formula
.Cells(i, 3).Value = Cell.Address
(RowAbsolute:=False, ColumnAbsolute:=False)
.Cells(i, 4).Value = Cell.Locked

'Increment the row counter
i = i + 1
End If
Next Cell
Next wks
End If

i = i + 2
'Check if the workbook contains Names
.Cells(i, 1).Value = "Name"
.Cells(i, 1).Font.Bold = True
.Cells(i, 2).Value = "Refers to"
.Cells(i, 2).Font.Bold = True

If ThisWorkbook.Names.Count 0 Then
'If true display a list of Names
.Cells(i + 1, 1).ListNames
Else
.Cells(i + 1, 2).Value = "This Workbook
contains no named ranges. "

End If

'Format the list
With .Columns("A:A")
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.WrapText = True
End With

With .Columns("B:B")
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.ColumnWidth = 70
.WrapText = True
.Cells.EntireRow.AutoFit
End With

Range("A1").Select
End With

'Switch screen updating back on
Application.ScreenUpdating = True
Exit Sub
End Sub

--
RMC,CPA


"Steve" wrote in message
...
I have written a program using Excel 2000 and am trying to
get it copyrighted. The Copyright office wants the source
code. How do I get that? Is there a way to print the
formulas that I developed? Thanks
Steve


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating Source Code in Charts University Charts and Charting in Excel 0 September 19th 06 08:12 PM
Source code for combo box in form shnim1 Excel Discussion (Misc queries) 1 April 14th 06 04:46 AM
Hard-code source data Melanie Martin Charts and Charting in Excel 5 December 29th 05 02:07 PM
Viewing source code when saved as web page Mark Excel Discussion (Misc queries) 1 March 31st 05 06:26 AM
Calling HTML Source code from within VBA for Excel Peter Dickson Excel Programming 0 July 9th 03 08:38 PM


All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"