Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pock,
this will work if the cells with no time are actually blank, rather than having spaces in them or something. Watch out for the text wrap after the "If" statement. I've included a few lines at the end which will scroll back up and delete the entries with no time against them: if you want to use this just remove the comment marks, if not leave it as it is. Cheers, Pete Sub MatchTitles() Dim LastRow as integer, LastTime as integer, x as integer LastRow = ActiveSheet.UsedRange.Rows.Count LastTime = 2 For x = 2 to LastRow If Cells(x,1).value & Cells(x,2).value = "" Then Cells(LastTime,3).value = Cells(LastTime,3).Value_ & "<P" & Cells(x,3).value Else LastTime = x End If Next x 'For x = LastRow to 2 Step -1 'If cells(x,1)="" then ' rows(x).delete 'End if 'Next x End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pock,
this is what I meant about text wrap, these two lines should be written in the VBE window as one line without the underscore ("_") character. When I reply on the MS site, it has a very narrow text window. The code should read: Cells(LastTime,3).value = Cells(LastTime,3).Value & "<p" & Cells(x,3).value Pete Pock wrote in message ... Pete, Thanks a ton for your response. However, when I tried your code, the following line wouldn't compile: Cells(LastTime,3).value = Cells(LastTime,3).Value_ & "<p" & Cells(x,3).value It seemed to get stuck after the ampersand. Forgive me for my lack of coding genius. I took out the spaces but that still didn't help. Any suggestions? Thanks, Pock -------------------------------------- remove I_hate_SPAM_ from my address when sending me an email *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding subtitles to chart title | New Users to Excel | |||
Cut and Paste Macro | Excel Discussion (Misc queries) | |||
how do i split subtitles in a single cell? | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |