Hello there,
I'm looking for a code that copies the text after certain text.
So for example, in all my documents, A1 starts with "Design id.:" and then you have some text e.g. Design id.: 15047-PID-403 rev. 03
I want a code that says, copy and insert the text after "Design id.:", which in this case is 15047-PID-403 rev. 03
As of now my code is
Sub Get_Data_From_File()
Dim empty_row As Long
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A7:C50").Copy
ThisWorkbook.Worksheets("SelectFile").Range("A10").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Thanks a lot!
I'm looking for a code that copies the text after certain text.
So for example, in all my documents, A1 starts with "Design id.:" and then you have some text e.g. Design id.: 15047-PID-403 rev. 03
I want a code that says, copy and insert the text after "Design id.:", which in this case is 15047-PID-403 rev. 03
As of now my code is
Sub Get_Data_From_File()
Dim empty_row As Long
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A7:C50").Copy
ThisWorkbook.Worksheets("SelectFile").Range("A10").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Thanks a lot!