Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Window Message to Verify Data Already typed

I have a macro which calls €œlst€ files under specific directory (see macro
below).
Most of the time, the data is not typed accordingly to call the €œlst€ files.

I wonder if I can get a window message to tell me that "MAKE SURE DATA
TYPED ON CELLS C3, C5 AND C6 MATCH WITH LAB DATA".

Thanks in advance.
Maperalia


Sub List_lst_Files1()
Const basicPath = "S:\GEOTEST\shears\"
Const listSheetName = "List of lst Files"
Dim anyFileName As String
Dim searchFor As String
Dim rOffset As Long
Dim listBaseCell As Range

Application.ScreenUpdating = False

searchFor = basicPath & _
Worksheets("DEFAULTS").Range("C3").Value & "\" & _
Worksheets("DEFAULTS").Range("C5").Value & "*" & _
Worksheets("DEFAULTS").Range("C6").Value & "*.lst"
anyFileName = Dir$(searchFor)
Do While anyFileName < ""
listBaseCell.Offset(rOffset, 0) = anyFileName
rOffset = rOffset + 1
anyFileName = Dir$ ' gets next match for original 'mask'
Loop
Set listBaseCell = Nothing ' release resource


Application.ScreenUpdating = False

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Window Message to Verify Data Already typed

See changes below (marked with **)
--
JNW


"maperalia" wrote:

I have a macro which calls €œlst€ files under specific directory (see macro
below).
Most of the time, the data is not typed accordingly to call the €œlst€ files.

I wonder if I can get a window message to tell me that "MAKE SURE DATA
TYPED ON CELLS C3, C5 AND C6 MATCH WITH LAB DATA".

Thanks in advance.
Maperalia


Sub List_lst_Files1()
Const basicPath = "S:\GEOTEST\shears\"
Const listSheetName = "List of lst Files"
Dim anyFileName As String
Dim searchFor As String
Dim rOffset As Long
Dim listBaseCell As Range

Application.ScreenUpdating = False

** onerror goto ErrRoutine
searchFor = basicPath & _
Worksheets("DEFAULTS").Range("C3").Value & "\" & _
Worksheets("DEFAULTS").Range("C5").Value & "*" & _
Worksheets("DEFAULTS").Range("C6").Value & "*.lst"
anyFileName = Dir$(searchFor)
Do While anyFileName < ""
listBaseCell.Offset(rOffset, 0) = anyFileName
rOffset = rOffset + 1
anyFileName = Dir$ ' gets next match for original 'mask'
Loop
Set listBaseCell = Nothing ' release resource

** Application.screenupdating = false
** Exit sub
** ErrRoutine:
** msgbox "MAKE SURE DATA TYPED ON CELLS C3, C5 AND C6 MATCH WITH LAB DATA"
Application.ScreenUpdating = False

End Sub

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
unusual window message edwin_dammam Excel Discussion (Misc queries) 2 March 8th 10 10:31 PM
How can I check/verify data in my Data Source for Pivot table? gayleh Excel Worksheet Functions 1 April 16th 08 08:30 PM
when certain number is typed in a cell to display a message Wanna Learn Excel Discussion (Misc queries) 8 September 18th 06 02:27 PM
Window Message for not value found maperalia Excel Programming 4 April 20th 06 01:00 AM
Adding message window Guido van Lammeren Excel Discussion (Misc queries) 2 October 7th 05 11:12 PM


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