Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Macro to force cell entry before running

I have a macro that copies a master sheet and places at the end of the
workbook by clicking a button. Is there away to have it force the user to
put the start date in a cell then continue with the macro once a value is
entered?


Thanks,
CJ

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Macro to force cell entry before running

We always prefer that you post your macro here for comments
Sub checkg9()
If Not IsDate(Range("g9")) Then MsgBox "fix date"
End Sub
--
Don Guillett
SalesAid Software

"Chance224" wrote in message
...
I have a macro that copies a master sheet and places at the end of the
workbook by clicking a button. Is there away to have it force the user to
put the start date in a cell then continue with the macro once a value is
entered?


Thanks,
CJ



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Macro to force cell entry before running

The following is the Macro used. How do I insert your macro to run with
this? I would like is to force an entry into cell BR15 if it is blank and
then continue to copy the sheet.

Sub Copy_Click()
'
'
Sheets(" Master").Copy After:=Sheets(ActiveWorkbook.Worksheets.Count)
ActiveSheet.Range("AC3").Value = "Enter Date"
ActiveSheet.Range("K7").Value = "Enter Well Number"
ActiveSheet.Range("AY104").Formula = "=AY101+'" & ActiveSheet.Previous.Name _
& "'!AY104"

MsgBox ("Please Change The DATE & WELL NUMBER. Thank You & Stay Safe!
Remember You Can ONLY Use - For Date Entries")

End Sub

Thanks,
CJ

"Don Guillett" wrote:

We always prefer that you post your macro here for comments
Sub checkg9()
If Not IsDate(Range("g9")) Then MsgBox "fix date"
End Sub
--
Don Guillett
SalesAid Software

"Chance224" wrote in message
...
I have a macro that copies a master sheet and places at the end of the
workbook by clicking a button. Is there away to have it force the user to
put the start date in a cell then continue with the macro once a value is
entered?


Thanks,
CJ




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Macro to force cell entry before running

How about propmting the user for the start date using an input box. If they
eneter a date then create the sheet otherwise dispaly a message... Something
like this...

Public Sub CopyMaster()
Dim wksMaster As Worksheet
Dim wksCopy As Worksheet
Dim strStartDate As Date

strStartDate = InputBox("Please enter the start date.")

If IsDate(strStartDate) Then

Set wksMaster = Sheets("Master")
wksMaster.Copy After:=Sheets(Sheets.Count)
Set wksCopy = ActiveSheet
wksCopy.Range("A1").Value = CDate(strStartDate)

wksMaster.Select
Set wksCopy = Nothing
Set wksMaster = Nothing

Else
MsgBox "Invalid Start Date. Please try again."
End If

End Sub

"Chance224" wrote:

I have a macro that copies a master sheet and places at the end of the
workbook by clicking a button. Is there away to have it force the user to
put the start date in a cell then continue with the macro once a value is
entered?


Thanks,
CJ



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
Force entry in one cell due to the value in the other WT Excel Worksheet Functions 4 March 30th 10 10:54 PM
Force entry into cell, based on validation selection in adjacent cell Richhall[_2_] Excel Worksheet Functions 3 June 18th 09 10:28 AM
Force required entry in cell before leaving that cell Retired Bill Excel Worksheet Functions 8 March 17th 09 10:57 PM
How do I force entry in multiple cell ranges in one worksheet CindyB Excel Worksheet Functions 0 July 10th 08 06:08 PM
Validation to force entry in a cell Matt D Francis Excel Worksheet Functions 4 October 4th 05 02:38 PM


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