Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default How to provide sample workbook?

Personally I'm not militant about attachments. For one thing I set Outlook
Express to color code large messages so it's easy to see the ones with
attachments, and I have broadband at work and at home. But I know others
operate differently. Someday I like to think, with broadband becoming for
prevalent, the "prohibition" could be lifted.

Anyway, most "sample data" is simple enough that I don't mind a little
typing. I think I would be put off by a macro that dumped the data; might
take me longer to check the macro than type the data. And from the poster's
side, creating the data dumping macro is a lot more trouble.


--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default How to provide sample workbook?

Jim,

Personally I'm not militant about attachments. For one thing I set Outlook
Express to color code large messages so it's easy to see the ones with
attachments, and I have broadband at work and at home. But I know others
operate differently. Someday I like to think, with broadband becoming for
prevalent, the "prohibition" could be lifted.


You have a point but I'd want there to be a specific 'attachments'
group so that I could opt out. I line in a rural area in England and
broadband will be unavailable for some time yet. And I prefer to read
and post from Google groups so attachments are meaningless in that
context.

Anyway, most "sample data" is simple enough that I don't mind a little
typing.


I usually do just a brief description myself. For example, in this
case I originally said:

"For example, my range is A1:C10 and I want to delete the
row which has the value 'Pies' in the first column, so
if A4="Pies" I want to delete A4:C4 by shifting cells
A5:C10 up"

I thought this was enough - after all, the actual values could be
anything - but the only reply I got asked me to send a workbook in a
personal email. (I still haven't got a reply from that one, must
follow it up...)

I think I would be put off by a macro that dumped the data; might
take me longer to check the macro than type the data.


That's what I feared. My suggestion was for the reader to create the
workbook and manually run the macro. I thought that a macro that
created a workbook etc would look 'suspicious'.

And from the poster's
side, creating the data dumping macro is a lot more trouble.


Yes, many posters to this group wouldn't have the ability to do it
(that's why they're here!) But because I can, I feel I should do all I
can to help people help me. What's ten minutes coding if I can get an
answer?

If anyone can give me suggestions on what a data dumping macro should
look like I'd be grateful to have them.

"Jim Rech" wrote in message ...

Personally I'm not militant about attachments. For one thing I set Outlook
Express to color code large messages so it's easy to see the ones with
attachments, and I have broadband at work and at home. But I know others
operate differently. Someday I like to think, with broadband becoming for
prevalent, the "prohibition" could be lifted.

Anyway, most "sample data" is simple enough that I don't mind a little
typing. I think I would be put off by a macro that dumped the data; might
take me longer to check the macro than type the data. And from the poster's
side, creating the data dumping macro is a lot more trouble.

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
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 09:14 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"