PC Review


Reply
Thread Tools Rate Thread

determine if activecell in specific worksheet and column

 
 
Scotty9349
Guest
Posts: n/a
 
      1st Jul 2009

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.
 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      1st Jul 2009

Scotty,

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

HTH,
Bernie
MS Excel MVP


"Scotty9349" <(E-Mail Removed)> wrote in message
news:224AEEEB-8059-4A43-8C9B-(E-Mail Removed)...
>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.



 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      1st Jul 2009

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" <(E-Mail Removed)> wrote in message
news:224AEEEB-8059-4A43-8C9B-(E-Mail Removed)...
>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.


 
Reply With Quote
 
Dick Kusleika
Guest
Posts: n/a
 
      1st Jul 2009

On Wed, 1 Jul 2009 07:40:01 -0700, Scotty9349
<(E-Mail Removed)> 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
 
Reply With Quote
 
Scotty9349
Guest
Posts: n/a
 
      1st Jul 2009

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 With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      1st Jul 2009

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" <(E-Mail Removed)> wrote in message
news:91813C60-F0DF-4DC6-98F7-(E-Mail Removed)...
> 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 With Quote
 
Scotty9349
Guest
Posts: n/a
 
      1st Jul 2009

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" <(E-Mail Removed)> wrote in message
> news:91813C60-F0DF-4DC6-98F7-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
determine whether the activecell is on the top or bottom John Smith Microsoft Excel Programming 3 31st Aug 2009 02:29 AM
Determine if filter set on specific column jday Microsoft Excel Programming 3 10th Mar 2009 10:37 PM
TOTAL A SPECIFIC COLUMN FOR EACH WORKSHEET Wanda Microsoft Excel Worksheet Functions 4 20th Oct 2008 07:31 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Microsoft Excel Misc 1 2nd Oct 2007 08:05 PM
Assistance with macro to determine if a specific worksheet is pres =?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?= Microsoft Excel Programming 6 3rd Feb 2006 01:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:48 PM.