kanishkgarg
New Member
- Joined
- Sep 29, 2021
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
I need to make a macro which asks the user to select an excel file, then goes through each column (without headers), identifies the column who values have a length of only 7 and copy it into the original excel where the macro is.
I am thinking of making a for loop but i am unable to code the part where it looks through the entire column and not just a particular cell.
Help would be much appreciated on this seemingly simple matter!
VBA Code:
Sub Upload()
InitializeSettings
Dim FindOrdernummer As Range
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename("Excel Files (*.xls; *.xlsx), *.xls; *.xlsx", , "Browse for your File & Import")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A1:Z70").Find
End If
Application.ScreenUpdating = True
End Sub
I am thinking of making a for loop but i am unable to code the part where it looks through the entire column and not just a particular cell.
Help would be much appreciated on this seemingly simple matter!