Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default determine if activecell in specific worksheet and column


I have a workbook that contains 3+ worksheets. Within 2 of those worksheets I
have 2 columns each that are for dates. WHen I run my insert_date sub (which
I have working) I only want a date to be inserted in those specific columns.
The cell that they enter that date is the activecell.

I hope this makes sense.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default determine if activecell in specific worksheet and column


Scotty,

Post your code, and a description of where you want the date placed.

HTH,
Bernie
MS Excel MVP


"Scotty9349" wrote in message
...
I have a workbook that contains 3+ worksheets. Within 2 of those worksheets I
have 2 columns each that are for dates. WHen I run my insert_date sub (which
I have working) I only want a date to be inserted in those specific columns.
The cell that they enter that date is the activecell.

I hope this makes sense.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default determine if activecell in specific worksheet and column


Your description is just a little bit too skimpy for us (well, at least me)
to figure out what you have and what you want to do with it. For example,
you say "they enter the date in the activecell", but earlier you say the
name of your sub is "insert_date"... are you taking the date the user enters
and putting it somewhere else (those 2 columns you mentioned maybe), or is
something else going on? Can you provide us with more details?

--
Rick (MVP - Excel)


"Scotty9349" wrote in message
...
I have a workbook that contains 3+ worksheets. Within 2 of those worksheets
I
have 2 columns each that are for dates. WHen I run my insert_date sub
(which
I have working) I only want a date to be inserted in those specific
columns.
The cell that they enter that date is the activecell.

I hope this makes sense.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default determine if activecell in specific worksheet and column


On Wed, 1 Jul 2009 07:40:01 -0700, Scotty9349
wrote:

I have a workbook that contains 3+ worksheets. Within 2 of those worksheets I
have 2 columns each that are for dates. WHen I run my insert_date sub (which
I have working) I only want a date to be inserted in those specific columns.
The cell that they enter that date is the activecell.

I hope this makes sense.


If ActiveCell.Parent.Name < "Name of sheet that doesn't get dates" Then
If ActiveCell.Column = 3 Then 'Column C
'do thing
End If
End If

You can also use ActiveCell.Parent.Codename if you're worried about someone
renaming the sheets.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default determine if activecell in specific worksheet and column


Sorry for the confusion I caused. Let's see if I can explain better.

I have a workbook with 3 worksheets; Estimates, Projects, Closed. Within the
Projects and Closed worksheets columns A and B are for user entered dates.

I wrote a small userform to enter the info automatically. However, in the
event the user wanted to change the date later on I am working on a stand
alone insert_date sub.

Using the frmCalendar provided by MS Excel, I would like to pass the entered
date to a cell the user selects. The only stipulation is that the user must
select a cell in column A or B of the Projects or Closed worksheets. I can
pass the date into any cell the user selects, I just want to limit them where
dates can be entered.

I tried the following:

If ActiveSheet.Name = "Projects" Or ActiveSheet.Name = "Closed" Then
If ActiveCell.Column = "A" Or ActiveCell.Column = "B" Then
Insert_date
End If
Else
MsgBox "Enter date in correct field"
End If




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default determine if activecell in specific worksheet and column


If ActiveSheet.Name = "Projects" Or ActiveSheet.Name = "Closed" Then
If ActiveCell.Column = 1 Or ActiveCell.Column = 2 Then
Insert_date
End If
Else
MsgBox "Enter date in correct field"
End If

HTH,
Bernie
MS Excel MVP

"Scotty9349" wrote in message
...
Sorry for the confusion I caused. Let's see if I can explain better.

I have a workbook with 3 worksheets; Estimates, Projects, Closed. Within
the
Projects and Closed worksheets columns A and B are for user entered dates.

I wrote a small userform to enter the info automatically. However, in the
event the user wanted to change the date later on I am working on a stand
alone insert_date sub.

Using the frmCalendar provided by MS Excel, I would like to pass the
entered
date to a cell the user selects. The only stipulation is that the user
must
select a cell in column A or B of the Projects or Closed worksheets. I can
pass the date into any cell the user selects, I just want to limit them
where
dates can be entered.

I tried the following:

If ActiveSheet.Name = "Projects" Or ActiveSheet.Name = "Closed" Then
If ActiveCell.Column = "A" Or ActiveCell.Column = "B" Then
Insert_date
End If
Else
MsgBox "Enter date in correct field"
End If



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default determine if activecell in specific worksheet and column


Thanks. Boy do I feel stupid for being so close.

"Bernie Deitrick" wrote:

If ActiveSheet.Name = "Projects" Or ActiveSheet.Name = "Closed" Then
If ActiveCell.Column = 1 Or ActiveCell.Column = 2 Then
Insert_date
End If
Else
MsgBox "Enter date in correct field"
End If

HTH,
Bernie
MS Excel MVP

"Scotty9349" wrote in message
...
Sorry for the confusion I caused. Let's see if I can explain better.

I have a workbook with 3 worksheets; Estimates, Projects, Closed. Within
the
Projects and Closed worksheets columns A and B are for user entered dates.

I wrote a small userform to enter the info automatically. However, in the
event the user wanted to change the date later on I am working on a stand
alone insert_date sub.

Using the frmCalendar provided by MS Excel, I would like to pass the
entered
date to a cell the user selects. The only stipulation is that the user
must
select a cell in column A or B of the Projects or Closed worksheets. I can
pass the date into any cell the user selects, I just want to limit them
where
dates can be entered.

I tried the following:

If ActiveSheet.Name = "Projects" Or ActiveSheet.Name = "Closed" Then
If ActiveCell.Column = "A" Or ActiveCell.Column = "B" Then
Insert_date
End If
Else
MsgBox "Enter date in correct field"
End If




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
Determine if filter set on specific column jday Excel Programming 3 March 10th 09 10:37 PM
determine activecell and move to it after running ohter sub... SpeeD Excel Programming 3 February 25th 09 02:18 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Assistance with macro to determine if a specific worksheet is pres Barb Reinhardt Excel Programming 6 February 3rd 06 01:19 PM
Trigger macro if an Activecell is within a specific Range helmekki[_43_] Excel Programming 2 October 23rd 04 03:56 PM


All times are GMT +1. The time now is 03:12 AM.

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"