Macro to find specfic header or begin from Active cell..

bchill

New Member
Joined
Aug 4, 2009
Messages
40
Hello Group,

Does anyone know if this is possible?

I have multiple formats for different reports, but I will always choose to begin my macro from the header titled "Description".

If that is too difficult, I would like to be able to select the header "Description" on my own, and allow the macro to begin from that point.

I have been searching this site all afternoon without any luck. I would grealt appreciate your help.

Here is the macro I have so far, which does what I need except it only works for one format. I would like the macro to start from a selected cell, and ontinued from there.

Code:
'
    Columns("H:H").Select
    Selection.Insert Shift:=xlToRight
    Range("H1").Select
    ActiveCell.FormulaR1C1 = "Brazil Coded?"
    Range("H2").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(ISERROR(FIND(""NCM"",RC[-1],1))=TRUE,""NOT CODED"",""CODED"")"
    Range("H2").Copy Range("H2", Range("H" & Range("E" & Rows.Count).End(xlUp).Row))
    Columns("H:H").Select
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.Goto Reference:="R1C104"
    Application.CutCopyMode = False
    Selection.ClearContents
    Application.Goto Reference:="R1C1"
    Columns("H:H").EntireColumn.AutoFit
End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,215,472
Messages
6,125,010
Members
449,204
Latest member
tungnmqn90

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