Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Search Specific Column for a matched entry

Hello All,

I use the code listed below to insert values entered on a UserForm, into the
next empty row in the 'Stockpile Reading Log'. Everything works great except:

Before the entry on the user form is added to the 'Stockpile' sheet, i want
the system to take the date entered in the 'Reading Date' field of the user
form, and search column 'A' of the 'Stockpile Log'. If the date exists
already in the column, i want the system to alert the user that the date
already exists, and cancel the process. I do not want rows to be entered
into the sheet that contain a date that already exists.

Can anyone help me with this request?
--
Carlee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Search Specific Column for a matched entry

What code??? That would help.

"Carlee" wrote:

Hello All,

I use the code listed below to insert values entered on a UserForm, into the
next empty row in the 'Stockpile Reading Log'. Everything works great except:

Before the entry on the user form is added to the 'Stockpile' sheet, i want
the system to take the date entered in the 'Reading Date' field of the user
form, and search column 'A' of the 'Stockpile Log'. If the date exists
already in the column, i want the system to alert the user that the date
already exists, and cancel the process. I do not want rows to be entered
into the sheet that contain a date that already exists.

Can anyone help me with this request?
--
Carlee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Search Specific Column for a matched entry

It's stealth code, Barb!

"Barb Reinhardt" wrote:

What code??? That would help.

"Carlee" wrote:

Hello All,

I use the code listed below to insert values entered on a UserForm, into the
next empty row in the 'Stockpile Reading Log'. Everything works great except:

Before the entry on the user form is added to the 'Stockpile' sheet, i want
the system to take the date entered in the 'Reading Date' field of the user
form, and search column 'A' of the 'Stockpile Log'. If the date exists
already in the column, i want the system to alert the user that the date
already exists, and cancel the process. I do not want rows to be entered
into the sheet that contain a date that already exists.

Can anyone help me with this request?
--
Carlee

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Search Specific Column for a matched entry

oops...Sorry guys!

Private Sub CmdSubmit_Click()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Dim sStr As String
Dim rFound As Range
Dim nResult As Long

Set WB = ThisWorkbook
Set SH = WB.Sheets("Stockpile Reading Log")
Set Rng = SH.Columns("A:A")
sStr = Me.dtpReadingDate.Value


Set rFound = SH.Range("A:A").Find(What:=sStr, LookIn:=xlValues)
If rFound Is Nothing Then

If MsgBox("Submit Stockpile Readings to Site Log?", vbYesNo) = vbYes Then

ActiveWorkbook.Sheets("Stockpile Reading Log").Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If

Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = dtpReadingDate.Value
ActiveCell.Offset(0, 1) = Me.txtPreparedBy.Value
'NW - #1 North
ActiveCell.Offset(0, 2) = Me.cbo1N1.Value
ActiveCell.Offset(0, 3) = Me.cbo1N2.Value
ActiveCell.Offset(0, 4) = Me.cbo1N3.Value
ActiveCell.Offset(0, 5) = Me.cbo1N4.Value
ActiveCell.Offset(0, 6) = Me.cbo1N5.Value
ActiveCell.Offset(0, 7) = Me.cbo1N6.Value
ActiveCell.Offset(0, 8) = Me.cbo1N7.Value
'NW - #2 North - E
ActiveCell.Offset(0, 9) = Me.cbo2N1E.Value
ActiveCell.Offset(0, 10) = Me.cbo2N2E.Value
ActiveCell.Offset(0, 11) = Me.cbo2N3E.Value
ActiveCell.Offset(0, 12) = Me.cbo2N4E.Value
ActiveCell.Offset(0, 13) = Me.cbo2N5E.Value
ActiveCell.Offset(0, 14) = Me.cbo2N6E.Value
ActiveCell.Offset(0, 15) = Me.cbo2N7E.Value
ActiveCell.Offset(0, 16) = Me.cbo2N8E.Value
....
Else
MsgBox "Your submission request has been cancelled."
End If
End If
End Sub

--
Carlee


"JLGWhiz" wrote:

It's stealth code, Barb!

"Barb Reinhardt" wrote:

What code??? That would help.

"Carlee" wrote:

Hello All,

I use the code listed below to insert values entered on a UserForm, into the
next empty row in the 'Stockpile Reading Log'. Everything works great except:

Before the entry on the user form is added to the 'Stockpile' sheet, i want
the system to take the date entered in the 'Reading Date' field of the user
form, and search column 'A' of the 'Stockpile Log'. If the date exists
already in the column, i want the system to alert the user that the date
already exists, and cancel the process. I do not want rows to be entered
into the sheet that contain a date that already exists.

Can anyone help me with this request?
--
Carlee

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
Search for a specific entry in a long data validation list Heinrich Excel Discussion (Misc queries) 1 May 4th 07 07:29 PM
APPROXIMATE SEARCH OF ANY ENTRY IN A COLUMN arun_bhilai Excel Worksheet Functions 1 October 28th 06 06:59 AM
matched entry complete not working whylite Excel Programming 0 September 27th 06 06:45 AM
Search Column - Find Multiple Entries - Sum Then Delete to Single Entry Ledge Excel Programming 5 June 19th 06 08:25 PM
search column for specific cell using vba dave91 Excel Programming 1 July 30th 05 05:59 PM


All times are GMT +1. The time now is 02:24 PM.

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"