![]() |
#1
|
|||
|
|||
![]()
Hello
I need ideally a formula that can do the following; Example of the cell A3 tag 1FINDandREPLACE Step 1: Look within a specified cell (i.e cell A3) and copy the tag in that cell. Step 2: Search within cell B2 (B2 contains various text that includes the tags). The tag in cell B2 is then to be replaced with the content from cell B3. Step 3: Repeat steps 1 & 2 for tags A3 to A9 and MASTER HTML FILE B1 to L1 and more This is a simple idea, but unfortunately I have not been able to find the code already in the forums that can do this task? Attached is the problem in the excel file. I look forward to your suggested formula, or if a formula is not possible, a macro could be used and any suggestions on the macro code would be helpful. Kind Regards David |
#2
|
||||
|
||||
![]()
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
||||
|
||||
![]()
I'd be inclined to use a macro:
Code:
Sub Demo() Application.ScreenUpdating = False Dim LRow As Long, LCol As Long, cCol As Long, cRow As Long Dim StrTmp As String, StrFnd As String, StrRep As String With ActiveSheet LRow = .Cells.SpecialCells(xlCellTypeLastCell).Row LCol = .Cells.SpecialCells(xlCellTypeLastCell).Column For cCol = 2 To LCol StrTmp = .Cells(2, cCol).Value For cRow = 3 To LRow If Trim(.Cells(cRow, 1).Value) = "" Then Exit For StrFnd = .Cells(cRow, 1).Value StrRep = .Cells(cRow, cCol).Value StrTmp = Replace(StrTmp, StrFnd, StrRep) Next .Cells(LRow + 2, cCol).Value = StrTmp Next End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ssarank | Word VBA | 3 | 12-25-2013 02:44 AM |
How to use Find and Replace with HTML tags? | srz92 | Word | 0 | 07-17-2013 07:55 AM |
![]() |
String | Word VBA | 4 | 06-06-2013 06:23 AM |
Attaching MSG file is stripped on send and HTML tags show on previewing prior to send | Fantastic4 | Outlook | 0 | 01-09-2012 12:18 PM |
![]() |
Ulodesk | Forum Support | 1 | 07-12-2011 07:54 AM |