Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Iinsert value into column L ...


If is possible with a mcro...

my problem, i have this sheet with many value into column A (all value
are already oredered) is possible to insert into column L the count
numebr of value repeated from a equal range block?
Example:
into line 3 and 4 is present the same value 4500450961 well inert into
column L the numer 2 into L3, blank the other line refered line 4

into line 11, 12 and 13 is present the same value 4500451080 well inert
into column L the numer 3 into L11, blank the other line refered line 12
and 13

if the value into acolumn A is present only one insert into column L
the value "0"

Tks.


+-------------------------------------------------------------------+
|Filename: ADD_NUMBER.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3786 |
+-------------------------------------------------------------------+

--
sal21


------------------------------------------------------------------------
sal21's Profile: http://www.excelforum.com/member.php...fo&userid=2040
View this thread: http://www.excelforum.com/showthread...hreadid=465484

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Iinsert value into column L ...

This is a bit ugly and assumes your data starts in row 2 i.e headings in
first row:

Sub huh()
Dim eRow As Long
Dim ColA As Range
Dim cell As Range
Dim cNtr As Long
Dim cRow As Long
Dim val As Variant '<change to suit data in column A

eRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Set ColA = Range(Cells(3, 1), Cells(eRow, 1))
val = Cells(2, 1).Value
cRow = 2
cNtr = 1
For Each cell In ColA
If cell.Value = val Then
cNtr = cNtr + 1
Else
If cNtr = 1 Then
Cells(cRow, 12).Value = 0
Else
Cells(cRow, 12).Value = cNtr
End If
cRow = cell.Row
cNtr = 1
val = cell.Value
End If
Next cell
End Sub

Hope this helps
Rowan

sal21 wrote:
If is possible with a mcro...

my problem, i have this sheet with many value into column A (all value
are already oredered) is possible to insert into column L the count
numebr of value repeated from a equal range block?
Example:
into line 3 and 4 is present the same value 4500450961 well inert into
column L the numer 2 into L3, blank the other line refered line 4

into line 11, 12 and 13 is present the same value 4500451080 well inert
into column L the numer 3 into L11, blank the other line refered line 12
and 13

if the value into acolumn A is present only one insert into column L
the value "0"

Tks.


+-------------------------------------------------------------------+
|Filename: ADD_NUMBER.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3786 |
+-------------------------------------------------------------------+

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Iinsert value into column L ...


Rowan Wrote:
This is a bit ugly and assumes your data starts in row 2 i.e headings
in
first row:

Sub huh()
Dim eRow As Long
Dim ColA As Range
Dim cell As Range
Dim cNtr As Long
Dim cRow As Long
Dim val As Variant '<change to suit data in column A

eRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Set ColA = Range(Cells(3, 1), Cells(eRow, 1))
val = Cells(2, 1).Value
cRow = 2
cNtr = 1
For Each cell In ColA
If cell.Value = val Then
cNtr = cNtr + 1
Else
If cNtr = 1 Then
Cells(cRow, 12).Value = 0
Else
Cells(cRow, 12).Value = cNtr
End If
cRow = cell.Row
cNtr = 1
val = cell.Value
End If
Next cell
End Sub

Hope this helps
Rowan

sal21 wrote:
If is possible with a mcro...

my problem, i have this sheet with many value into column A (all

value
are already oredered) is possible to insert into column L the count
numebr of value repeated from a equal range block?
Example:
into line 3 and 4 is present the same value 4500450961 well inert

into
column L the numer 2 into L3, blank the other line refered line 4

into line 11, 12 and 13 is present the same value 4500451080 well

inert
into column L the numer 3 into L11, blank the other line refered line

12
and 13

if the value into acolumn A is present only one insert into column L
the value "0"

Tks.



+-------------------------------------------------------------------+
|Filename: ADD_NUMBER.zip

|
|Download: http://www.excelforum.com/attachment.php?postid=3786

|

+-------------------------------------------------------------------+


Work fine!


--
sal21


------------------------------------------------------------------------
sal21's Profile: http://www.excelforum.com/member.php...fo&userid=2040
View this thread: http://www.excelforum.com/showthread...hreadid=465484

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
divide column(x) by column(y) to give column(x/y) in excel? James New Users to Excel 2 April 24th 23 11:46 AM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Return text in Column A if Column B and Column K match jeannie v Excel Worksheet Functions 4 December 13th 07 07:36 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Divide Column A by Column B multiply Column C Stumped Excel Worksheet Functions 3 December 28th 05 05:51 AM


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