LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
RAP RAP is offline
external usenet poster
 
Posts: 49
Default Macro syntax difficulties (long post)

The suspect the source of my problem is I am running Excel 2003 and my
reference books are for Excel 2000 and Excel/VB for Windows 95. Apparently,
different versions use different syntax. Or maybe I have Dain-Bramage or
something€¦.

SETUP: A user selects a date, enters data and exits the program.

The data entered is saved on a page named RawDailyData. The first ROW has a
date for a certain number of days entered on it, beginning in cell C1

Page 1 is named StartPage, Page 2 is named DataInput, Page 3 is named
RawDailyData

When a user opens the file and enables the macros, the file opens to the
StartPage. User sees the following:

Step 1 = Choose a date €śA date is selected from a listbox in a cell named
EntryDate€ť
Step 2 = Click the GO button to enter data for selected date
Step 3 = Click the Save & Exit button

The GO command button calls the GO macro. I want the GO macro to do the
following:
1. See if data already exists on the RawDailyData page for the selected
EntryDate.
2. If true, bring up the UserForm1

€˘ UserForm1 has a message and a single command button, named RETURN. The
message says to click the return button and select another EntryDate, because
data for that date has already been entered. Currently, the button simply
unloads the userform, essentially returning the user to the EntryDate select
box. (I do not want the user to be able to overwrite existing data)

3. If false, (that is, no previous data has been entered for the selected
EntryDate)
nothing happens when the GO button is clicked except that the user is
directed
to the first data entry cell on the DataInput page to begin entering
data.

I can achieve a TRUE/FALSE result, using a nested worksheet function
IF/HLOOKUP.
=IF(HLOOKUP(EntryDate,RawDailyData!C1:IM2,2,FALSE) <"",TRUE,FALSE)

The first line of data is saved on Row 2. If anything, even a zero, is
entered in that cell, the formula results in a TRUE. The cell must be blank
for a FALSE.

PROBLEM: When I try to achieve the same result using a macro, I simply cannot
get all the syntax correct. Any assistance would be greatly appreciated.

Randy

 
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
IF/AND/OR/DATEIF Issue...sorry...long post... EDSTAFF Excel Worksheet Functions 1 November 10th 05 12:28 AM
Another syntax question (different from earlier post) Marty Excel Programming 3 March 6th 05 06:11 PM
A few VBA questions - long post! Fiona O'Grady Excel Discussion (Misc queries) 5 December 19th 04 04:12 PM
Previous Post - Correct Syntax Query Clarence Crow Excel Worksheet Functions 0 December 7th 04 05:35 AM
Re-Post: Long and Varying Worksheet Save Times Joe Adams[_2_] Excel Programming 0 February 24th 04 03:20 PM


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