Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Detecting if AutoFill was used?

I have the need to determine if a specific range of cells
have values resulting from an autofill action.

Example:
If Range("C7").Value = "Jan", and AutoFill was used to
make C7-K7 = "Jan","Feb","Mar",etc

How can I tell programmatically that AutoFill was used to
perform this action?

I can easily do this:

ThisWorkSheet = Excel.Application.ActiveSheet

With ThisWorkSheet
If .Range("C7").Value = "Jan" _
And .Range("D7").Value = "Feb" _
And .Range("E7").Value = "Mar" _
And .Range("F7").Value = "Apr" _
And .Range("G7").Value = "May" _
And .Range("H7").Value = "Jun" _
And .Range("I7").Value = "Jul" _
And .Range("J7").Value = "Aug" _
And .Range("K7").Value = "Sep" Then
MsgBox("Cool")
Else
MsgBox("Not Cool")
End If
End With

But, that doesn't reach my goal of finding out if
AutoFill was used.

Thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Detecting if AutoFill was used?

the best you can determine is if the results are consistent with the use of
Autofill.

--
Regards,
Tom Ogilvy


"Gilroy" wrote in message
...
I have the need to determine if a specific range of cells
have values resulting from an autofill action.

Example:
If Range("C7").Value = "Jan", and AutoFill was used to
make C7-K7 = "Jan","Feb","Mar",etc

How can I tell programmatically that AutoFill was used to
perform this action?

I can easily do this:

ThisWorkSheet = Excel.Application.ActiveSheet

With ThisWorkSheet
If .Range("C7").Value = "Jan" _
And .Range("D7").Value = "Feb" _
And .Range("E7").Value = "Mar" _
And .Range("F7").Value = "Apr" _
And .Range("G7").Value = "May" _
And .Range("H7").Value = "Jun" _
And .Range("I7").Value = "Jul" _
And .Range("J7").Value = "Aug" _
And .Range("K7").Value = "Sep" Then
MsgBox("Cool")
Else
MsgBox("Not Cool")
End If
End With

But, that doesn't reach my goal of finding out if
AutoFill was used.

Thoughts?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Detecting if AutoFill was used?

Thanks for the feedback Tom. I suspected that was the
answer. ;)

-----Original Message-----
the best you can determine is if the results are

consistent with the use of
Autofill.

--
Regards,
Tom Ogilvy


"Gilroy" wrote in message
...
I have the need to determine if a specific range of

cells
have values resulting from an autofill action.

Example:
If Range("C7").Value = "Jan", and AutoFill was used to
make C7-K7 = "Jan","Feb","Mar",etc

How can I tell programmatically that AutoFill was used

to
perform this action?

I can easily do this:

ThisWorkSheet =

Excel.Application.ActiveSheet

With ThisWorkSheet
If .Range("C7").Value = "Jan" _
And .Range("D7").Value = "Feb" _
And .Range("E7").Value = "Mar" _
And .Range("F7").Value = "Apr" _
And .Range("G7").Value = "May" _
And .Range("H7").Value = "Jun" _
And .Range("I7").Value = "Jul" _
And .Range("J7").Value = "Aug" _
And .Range("K7").Value = "Sep" Then
MsgBox("Cool")
Else
MsgBox("Not Cool")
End If
End With

But, that doesn't reach my goal of finding out if
AutoFill was used.

Thoughts?



.

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
Detecting Calc On or Off dhstein Excel Discussion (Misc queries) 5 April 22nd 09 10:41 AM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Detecting absentees gracegift Excel Discussion (Misc queries) 7 December 27th 04 11:35 PM
Detecting a color Duncan Help Excel Worksheet Functions 5 December 9th 04 08:12 PM
Detecting VBA code Chris Gorham[_3_] Excel Programming 1 November 1st 03 08:34 PM


All times are GMT +1. The time now is 01:59 PM.

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"