Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Do Until VB Macro

Greetings:

I am not sure how to get excel to perform this function. I would like
a macro to find the text value C in column C and autofill the letter C
in column A until it comes to the text value D in column C and
continue to autofill the letter D in column A. Any help would be
greatly appreciated. Thank you in advance.

Jerry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Do Until VB Macro

Jerry,

You could do something like:

Sub TryNow()
Dim myCell As Range
Dim FoundC As Boolean
Dim FoundD As Boolean

FoundC = False
FoundD = False

For Each myCell In Intersect(Range("C:C"), ActiveSheet.UsedRange)
If FoundC Or myCell.Value = "C" Then
FoundC = True
Cells(myCell.Row, 1).Value = "C"
End If
If FoundD Or myCell.Value = "D" Then
FoundC = False
FoundD = True
Cells(myCell.Row, 1).Value = "D"
End If
Next myCell
End Sub

HTH,
Bernie
MS Excel MVP

"Jerry" wrote in message
om...
Greetings:

I am not sure how to get excel to perform this function. I would like
a macro to find the text value C in column C and autofill the letter C
in column A until it comes to the text value D in column C and
continue to autofill the letter D in column A. Any help would be
greatly appreciated. Thank you in advance.

Jerry



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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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