Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Eladamri" wrote in message ... Hi Guys, I'm trying to come up with a macro program to get the Sequence no. (in bold font) and write it in column C. In Colum A I have the data below, In Column B I have the Incident number and In column C i wish to write the extracted nubmers from Column A. I was thinking that the word Sequence no. can be used as a search item so that excel will know that the number below it is the number that needs to be written on column C. I hope you can respond to this i have been working for hours to get this running but I haven't really got any success so far. Thanks in advance. Description Vendor/Supplier:XXXXXXXXX Invoice no. Sequence no. 10024350 10024370 Vendor/Supplier: XXXXXXXXXX Invoice no. SKU/PLU No. 8888010101618 8888010101601 Sequence No. 13016989 Maybe something like this: Sub Sequence() Dim SequenceFollows As Boolean For Each cell In Selection If SequenceFollows = True And IsNumeric(cell.Offset(0, -2)) Then cell.Value = cell.Offset(0, -2).Value Else SequenceFollows = False End If If LCase(cell.Offset(0, -2)) = "sequence no." Then SequenceFollows = True Next cell End Sub The macro assumes that you have selected cells in column C. It then searches all cells 2 columns to the left (column A), sets an internal flag if it finds the word "Sequence No. (you should be consistent in your spelling - you changed capitalization in your example) and then extracts the following numbers up to the next non-numeric value. Good luck. Joerg |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Extract Template Data to New Worksheet | Excel Worksheet Functions | |||
Creating a Macro Button to Extract Data | Excel Discussion (Misc queries) | |||
Creating a Macro Button to Extract Data | Excel Programming | |||
Creating a Macro Button to Extract Data | New Users to Excel | |||
Macro to extract data | Excel Discussion (Misc queries) |