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: 18
Default Help with Commands and Syntax please.

I have done some programming, but never any VBA in excel. I am needing
some help writing 2 ON EVENTS and 1 Function listed below. The logic
works, but the commands and Syntax are what I need help with.
ANY help would be greatly appreciated :-)


_______________On OPEN EVENT_____________________
This will tell me how many lines of data are on the sheet
when it is opend. (The + 5 is to allow for my headers)
Calls to the Function below.

ON OPEN EVENT()
Set DATALINES = 0
STart Loop
Datalines = Datalines + 1
IF CHKROW(DATALINES+5) = BLANK Then END
ELSE LOOP

_______________FUNCTION__________________

This Function returns the Status of the Row sent to it
and Returns Either FULL BLANK OR OUT


FUNCTION CHKROW(RTBC (ROW TO BE CHECKED)

IF ((RTBC < DATALINES) or (RTBC DATALINES)) THEN RETURN OUT
IF COUNTBLANK(RTBC 2:RTBK 6) = 4 RETURN BLANK
Else Return FULL
END FUNCTION

_______________ON CHANGE EVENT___________________

This Will check if the ROW Data was just changed is in the Data
field Range and adds or removes rows.(Calls on Function CHKROW Above)

ON EVENT CHANGE(
SET CROW = Row of the cell data changed in
SET CCOL = Collumn of the cell data changed in

IF (CCOL < 2) or CCOL 6 ) Then END
CR = CHKROW(CROW)
NR = CHKROW(CROW +1)
IF (CR=OUT or (CR=BLANK AND NR=OUT)) THEN END
IF (CR=FuLL AND NR=OUT) THEN
Copy ROW CR on Sheet1
Insert it at ROW CR+1 on Sheet1
Copy ROW CR on Sheet2
Insert it at ROW CR+1 on Sheet2
(Only copy Formating and Formulas not Values)
DATALINES=DATALINES + 1
END
If (CR=BLANK AND NR=FULL) THEN
DELETE ROW CR on SHeet1
DELETE ROW CR on SHeet2
DATALINES=DATALINES - 1
END

END EVENT

 
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
VBA commands Love2Learn Excel Discussion (Misc queries) 4 January 28th 09 07:31 AM
IF commands ryan Excel Worksheet Functions 1 August 17th 07 02:10 AM
DDE Commands Newby Excel Discussion (Misc queries) 0 October 17th 05 07:22 PM
DOS commands Taikoubo Excel Discussion (Misc queries) 0 March 30th 05 03:37 AM
Help with "if-then"/look up commands or what ever you think is best. [email protected] Excel Discussion (Misc queries) 2 March 16th 05 08:25 PM


All times are GMT +1. The time now is 04:44 PM.

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

About Us

"It's about Microsoft Excel"