Extrapolate Text within parenthesis while adjusting header lines, create time range

Livin404

Well-known Member
Joined
Jan 7, 2019
Messages
743
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Greetings, I have a Column I would like to adjust. Please refer to photo. In Column A whenever there is a date I only need that cell to shift up one (all the rows will have to move up together) as not to miss-align the rows. However I would like the date in its new row to show the day of the week, month, day of month followed by year. In the image for example for "A1" it would read "THURSDAY NOVEMBER 12 2020". In place where the date was I would need "ORIGIN" Regarding the parenthesis I have the following VBA which I got from an earlier post on "Mr. Excel". It removes brackets all right, but it removes everything that is not in a bracket. I only want it to work on places below where there are dates and to ignore blank rows. Thank you,


VBA Code:
 Sub ExtractFids()
  Dim Addr As String
  Addr = "A1:A" & Cells(Rows.Count, "A").End(xlUp).Row
  Range(Addr) = Evaluate(Replace("IF(ISNUMBER(FIND(""("",@)),TRIM(MID(LEFT(@,FIND("")"",@)-1),FIND(""("",@)+1,99)),@)", "@", Addr))
End Sub
 

Attachments

  • Send to Inbound.PNG
    Send to Inbound.PNG
    30.9 KB · Views: 5
WOW! That is exactly what I'm looking for! The only thing I may want to add; can I designate for a specific work sheet ("Inbound FIDS"}? That macro will be launched with other macros from a different work sheet? Thank you so much!!
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If I understand you correctly, we just need to qualify the ranges with the sheet reference...
VBA Code:
Sub Livin404()
  Dim X As Long
  With Sheets("Inbound FIDS").Range("A2", Sheets("Inbound FIDS").Cells(Rows.Count, "A").End(xlUp)).SpecialCells(xlConstants)
    For X = .Areas.Count To 1 Step -1
      If X > 1 Then .Areas(X)(1).EntireRow.Insert
      With .Areas(X)
        .Resize(1).Offset(-1).Value = .Value
        .Resize(1).Offset(-1).Replace "(*", Year(Now), xlPart, , , , False, False
        .Resize(1).Value = "Origin"
        .Offset(1).Replace "*(", ""
        .Offset(1).Replace ")*", ""
      End With
    Next
  End With
End Sub
 
Upvote 0
Solution
indeed everything you provided was perfect. I just wanted it to specify the worksheet. Thank you.
 
Upvote 0
I'm wrapping up this project, your contribution is huge. I failed to ask at the time I need to have the word "Date:" in front of the date. I did make a feeble attempt at adding the necessary changes but to no avail.
Excel Formula:
.Resize(1).Offset(-1).Value = ("Date:") + .Value

Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,215,024
Messages
6,122,729
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top