Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how do i incrememnt a cell?

i have a sorted column of dates. what i'm trying to do is find if ther
are any dates that are duplicates. if they are, they would b
consecutive. this is what i've got so far.

Option Explicit
Sub FindDouble()
Dim c As Range
For Each c In Range("D1:D4000")
If c.Value = [c+1].Value Then
c.Font.Bold = True
End If
Next c
End Sub

c+1.Value doesn't work. how do i check the value of the cell below th
current cell

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default how do i incrememnt a cell?

Try C.offset(1,0)

Regards
Jamal
-----Original Message-----
i have a sorted column of dates. what i'm trying to do is

find if there
are any dates that are duplicates. if they are, they

would be
consecutive. this is what i've got so far.

Option Explicit
Sub FindDouble()
Dim c As Range
For Each c In Range("D1:D4000")
If c.Value = [c+1].Value Then
c.Font.Bold = True
End If
Next c
End Sub

c+1.Value doesn't work. how do i check the value of the

cell below the
current cell?


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how do i incrememnt a cell?

Both of these examples will work.....

For...Next example
Assumption: there could be holes in the data and you need to chec
every cell.
Assumption: if the second cell was duplicate bold the first and not th
second

Public Sub IncrementFor()

Dim x As Integer
For x = 1 To 4000

If ActiveSheet.Cells(x, 4) = ActiveSheet.Cells(x + 1, 4) Then
ActiveSheet.Cells(x, 4).Select
Selection.Font.Bold = True
End If

Next x

End Sub

Do...Loop example
Assumption: there are no holes in the data and you only need to go dow
column 'd' untill a cell is blank
Assumption: if the second cell was duplicate bold the first and not th
second

Public Sub IncrementDo()

Dim x As Integer
x = 1
Do Until ActiveSheet.Cells(x, 4) = ""

If ActiveSheet.Cells(x, 4) = ActiveSheet.Cells(x + 1, 4) Then
ActiveSheet.Cells(x, 4).Select
Selection.Font.Bold = True
End If
x = x + 1
Loop

Mark Wielgus
www.AutomateExcel.co

--
Message posted from http://www.ExcelForum.com

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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Excel Discussion (Misc queries) 0 June 26th 09 06:01 PM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


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