find column Ref.

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
883
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,
I have multiple files and tabs in excel data. and each tab has multiple columns so I need to find column Ref. where ever i have "Control" and "Delta" column only.


For attahced file it like B,C E,F

and all file has the same formate like row number 7 we can get control and Delta.

For ref. please see attached file.

Thanks in advance
Sanjeev.
 

Attachments

  • Find ref. column.png
    Find ref. column.png
    52 KB · Views: 9

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Please try this
VBA Code:
Sub ItsAllGood()
For Each Sheet In ThisWorkbook.Sheets
    ControlColumn = Sheet.Range("8:8").Find("Control").Column
    DeltaColumn = Sheet.Range("8:8").Find("Delta").Column
    Debug.Print "Control Column = " & ControlColumn
    Debug.Print "Delta Column = " & DeltaColumn
Next Sheet
End Sub
 
Upvote 0
Please try this
VBA Code:
Sub ItsAllGood()
For Each Sheet In ThisWorkbook.Sheets
    ControlColumn = Sheet.Range("8:8").Find("Control").Column
    DeltaColumn = Sheet.Range("8:8").Find("Delta").Column
    Debug.Print "Control Column = " & ControlColumn
    Debug.Print "Delta Column = " & DeltaColumn
Next Sheet
End Sub

Hi am not getting any data in the excel file. and I have check-in immediate "
getting the same column ref... instead of diff. column

Control Column = 3
Delta Column = 4
Control Column = 3Control Column = 3
Delta Column = 4
Control Column = 3
Delta Column = 4
Control Column = 3
Delta Column = 4

Delta Column = 4
"

Thanks in advance
Sanjeev
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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