Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Check range before pasting and modular approach questions

I am writing some utilities which I plan to bundle together in an add-in for
coworkers. Some of these utilities involve pasting information in
user-selected cells and others involve placing formulas in cells based on
userform input. In either case, I want to check the range prior to
pasting/inserting formulas.

Here is what I am planning to check and how:
- Is the selection a range?
- Is the selection a continuous range (using .Areas)?
- Does the selection contained locked/protected cells (using .AllowEdit)?
- Does the selection contain array formulas (using .HasArray)?
- Does the selection already contain something (using
WorksheetFunction.CountA)?

My questions:
1. Are there additional checks I need to make or any suggestions on the
methods I mentioned?
2. How should I 'arrange' these functions? I could create functions for
each of the checks, then call them from my main subroutine, I could create
one function with all of these checks and call that from my subroutine, or I
could create a function that calls on individual functions and call the one
function from my subroutine. I was planning to use the first option but as
I have just started 'modularizing' my code (versus the fourth option of
putting everything in the subroutine, which is what I used to do) I would
appreciate the opinion of others.

Sorry for the long post. Thanks in advance for your help.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Check range before pasting and modular approach questions

Hi,

I think you want to build a utility for your Appl. Excel ?

Keep tryin' of it by create one by one of your module

Or you can see J-Walk website ... that will give u much

Rgds,

Halim


M. Authement menuliskan:
I am writing some utilities which I plan to bundle together in an add-in for
coworkers. Some of these utilities involve pasting information in
user-selected cells and others involve placing formulas in cells based on
userform input. In either case, I want to check the range prior to
pasting/inserting formulas.

Here is what I am planning to check and how:
- Is the selection a range?
- Is the selection a continuous range (using .Areas)?
- Does the selection contained locked/protected cells (using .AllowEdit)?
- Does the selection contain array formulas (using .HasArray)?
- Does the selection already contain something (using
WorksheetFunction.CountA)?

My questions:
1. Are there additional checks I need to make or any suggestions on the
methods I mentioned?
2. How should I 'arrange' these functions? I could create functions for
each of the checks, then call them from my main subroutine, I could create
one function with all of these checks and call that from my subroutine, or I
could create a function that calls on individual functions and call the one
function from my subroutine. I was planning to use the first option but as
I have just started 'modularizing' my code (versus the fourth option of
putting everything in the subroutine, which is what I used to do) I would
appreciate the opinion of others.

Sorry for the long post. Thanks in advance for your help.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Check range before pasting and modular approach questions

The Use rForm input is the preferred method for accuracy. If you have to
allow a user to input directly to the spreadsheet, I would suggest using a
separate sheet from which you can edit and then transfer the data into the
main spreadsheet. However, with the edits you have planned, most of the
drawbacks are covered.

As for the code structure, I prefer to modularize as much as possible and
where practicable. It seems to run better and if there is a problem, you can
usually pin point it pretty easily. However, each code writer has their own
likes and dislikes. I also use the indent system so I can easily identify
what is embedded in what and make sure all my blocks and loops are complete.

Good Luck JLG

"M. Authement" wrote:

I am writing some utilities which I plan to bundle together in an add-in for
coworkers. Some of these utilities involve pasting information in
user-selected cells and others involve placing formulas in cells based on
userform input. In either case, I want to check the range prior to
pasting/inserting formulas.

Here is what I am planning to check and how:
- Is the selection a range?
- Is the selection a continuous range (using .Areas)?
- Does the selection contained locked/protected cells (using .AllowEdit)?
- Does the selection contain array formulas (using .HasArray)?
- Does the selection already contain something (using
WorksheetFunction.CountA)?

My questions:
1. Are there additional checks I need to make or any suggestions on the
methods I mentioned?
2. How should I 'arrange' these functions? I could create functions for
each of the checks, then call them from my main subroutine, I could create
one function with all of these checks and call that from my subroutine, or I
could create a function that calls on individual functions and call the one
function from my subroutine. I was planning to use the first option but as
I have just started 'modularizing' my code (versus the fourth option of
putting everything in the subroutine, which is what I used to do) I would
appreciate the opinion of others.

Sorry for the long post. Thanks in advance for your help.



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
Modular Arithmetic sirsoto Excel Programming 0 August 8th 06 01:11 AM
modular arithmetic sirsoto Excel Programming 1 July 22nd 05 07:41 AM
Macro - Modular fill function Chaz Excel Programming 3 July 6th 05 06:24 PM
Deleting blank rows in a range or another fill approach BigDave[_2_] Excel Programming 5 June 3rd 05 03:51 PM
2 questions about check boxes Tom S.[_2_] Excel Programming 1 October 11th 03 06:56 PM


All times are GMT +1. The time now is 02:01 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"