Hello,
I have no formal coding training or background and am attempting to teach myself a bit of VBA as we use a lot of spreadsheets in my job (oil and gas). Please excuse my very poor knowledge and dumb questions.
There is an xls we use which pulls in a lot of information from another application (PI processbooks) and as a result is running really slowly. I am trying to write a code which will find a row by date (looking for a date that is always yesterday) then copy and paste values everything prior to that. I am really struggling! I am trying to do the following
Find and select a cell in column A that matches another cell (J1). J1 is yesterdays date now()-1. Copy and paste values from that matched cell columns C:H up to the start of the workbook.
However I can't even get the find and select bit right, after hours of googling yesterday. A1 = B1, with the same date format as J1, though i am not sure if this is necessary?
Current code is
Thanks in advance for any help and again apologies for basic errors and silly questions.
I have no formal coding training or background and am attempting to teach myself a bit of VBA as we use a lot of spreadsheets in my job (oil and gas). Please excuse my very poor knowledge and dumb questions.
There is an xls we use which pulls in a lot of information from another application (PI processbooks) and as a result is running really slowly. I am trying to write a code which will find a row by date (looking for a date that is always yesterday) then copy and paste values everything prior to that. I am really struggling! I am trying to do the following
Find and select a cell in column A that matches another cell (J1). J1 is yesterdays date now()-1. Copy and paste values from that matched cell columns C:H up to the start of the workbook.
However I can't even get the find and select bit right, after hours of googling yesterday. A1 = B1, with the same date format as J1, though i am not sure if this is necessary?
Current code is
VBA Code:
Dim Found As Range
Range("A1").Select
Set Found = Cells.find(What:=Sheets("Sheet1").Range("J1").Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
Thanks in advance for any help and again apologies for basic errors and silly questions.