LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default How to provide sample workbook?

Like all good posters to this newsgroup I've read Chip's hints and
tips and try to follow them. I want to provide sample data and I
definitely don't want to encourage the posting of workbooks as
attachments.

If, like me, anyone here reads the database newsgroups they will be
familiar with a guy called Joe Celko and his signatu

"Please post DDL, so that people do not have to guess
what the keys, constraints, Declarative Referential
Integrity, datatypes, etc. in your schema are."

Data Definition Language (DDL) statements (CREATE TABLE..., INSERT
INTO..., etc) allow the reader to actually create the poster's
database simply by pasting the DLL into their database system and
pressing a button.

Recently, I was asked in this newsgroup for an example workbook and,
rather than send them an email and take the discussion outside the
group, I posted the following instructions on how to create my example
workbook:

"Open a new workbook, insert a standard module and paste in the
following sub procedu

Public Sub CreateDB()

Dim ws As Excel.Worksheet

Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Database").Delete
On Error GoTo 0
Application.DisplayAlerts = True

Set ws = ThisWorkbook.Worksheets.Add

With ws

ws.Name = "Database"

.Range("A1:C1").Value = Array("RefID", "Surname", "Balance")

.Range("A2:A11").Value = Application.Transpose(Array(1, _
2, 3, 4, 5, 6, 7, 8, 9, 10))
.Range("B2:B11").Value = Application.Transpose(Array("Nan", _
"Wet", "Ren", "Hip", _
"Nat", "Ter", "Doh", _
"Leh", "Rot", "Ton"))
.Range("C2:C11").Value = Application.Transpose(Array(Int(Rnd *
99), _
Int(Rnd * 99), Int(Rnd * 99), _
Int(Rnd * 99), Int(Rnd * 99), _
Int(Rnd * 99), Int(Rnd * 99), _
Int(Rnd * 99), Int(Rnd * 99), _
Int(Rnd * 99)))


End With

ThisWorkbook.Names.Add "Data", "=Database!$A$2:$C$11"

End Sub

And it struck me that I've never seen this kind of thing in this
newsgroup before. Usually, sample data is given in the text of post,
like this:

RefID Surname
----- -------
1 Nan
2 Wet
3 Ren
...

Even if it survives the various formatting it undergoes during the
posting process (e.g. via Google groups or Developer Network) I'm
rarely able to copy and paste it into a workbook.

I'm sure I'd be more willing to help someone if they provided me with
a quick and easy method to re-create their data, formulas, defined
Names, etc. And when I say easy, I essentially mean copy+paste and
press a button.

What do people here think? Are you frustrated with the way sample data
and workbooks are provided in this newsgroup? If you saw my CreateDB
routine in a posting, would you appreciate it as a short cut to seeing
my sample workbook? Or would you possibly dismiss it, for example
because it makes my posting look *more* complicated rather than
simplifying things?

I'd appreciate any views you may have.
 
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
Can I random sample from a set until every sample is selected? random sampling Excel Discussion (Misc queries) 6 April 26th 10 09:54 PM
How do I provide new sample spreadsheets to office online Dre[_2_] Excel Discussion (Misc queries) 0 April 5th 10 10:44 PM
Get Excel to provide equation for my x and y hasargent New Users to Excel 2 December 6th 07 12:01 PM
Can I provide links to different worksheets in the same workbook? Chrisinct Excel Discussion (Misc queries) 3 July 5th 06 03:44 PM
Hyperlink to provide feedback Smudger Excel Discussion (Misc queries) 6 February 4th 05 11:10 PM


All times are GMT +1. The time now is 04:05 AM.

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"