Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Lost in Alabama
 
Posts: n/a
Default Macro to find the first cell in a column with different data

Hello,

I really could use some of your expert and excellent help with a problem I
am having in creating a macro to perform a search in "Column A" to locate a
change in the data in that column and then move one column to the right and
one row down and type "1" in that cell.

I really appreciate your help, and Have a Blessed Holiday Season.

  #2   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Macro to find the first cell in a column with different data

Perhaps this might also do it here ..
Assuming data is in A1 down, of the structure as below:

1
1
1
2
2
3
3
etc

Put in B2: =IF(A2<A1,1,"")
Copy down

Kill the formulas in col B with an in-place:
Copy Paste special Check "Values" OK
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Lost in Alabama" <Lost in wrote in
message ...
Hello,

I really could use some of your expert and excellent help with a problem I
am having in creating a macro to perform a search in "Column A" to locate

a
change in the data in that column and then move one column to the right

and
one row down and type "1" in that cell.

I really appreciate your help, and Have a Blessed Holiday Season.



  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default Macro to find the first cell in a column with different data

Max has provided a formula.

If you want a macro, try this one.

Sub Addone_At_Change()
Dim i As Long
With Application
.Calculation = xlManual
.ScreenUpdating = False
End With
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) < Cells(i, 1) Then _
Cells(i, 1).Offset(1, 1).Value = 1
Next i
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
End With
End Sub


Gord Dibben Excel MVP

On Wed, 14 Dec 2005 07:06:07 -0800, Lost in Alabama <Lost in
wrote:

Hello,

I really could use some of your expert and excellent help with a problem I
am having in creating a macro to perform a search in "Column A" to locate a
change in the data in that column and then move one column to the right and
one row down and type "1" in that cell.

I really appreciate your help, and Have a Blessed Holiday Season.

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
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Finding last cell with data in a column Nigel Bennett Setting up and Configuration of Excel 2 April 29th 05 08:03 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 02:29 AM.

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"