Path not found, but the folders do exist
[code] Sub toPDF() ' This will copy a specified range('s) from ws1 & ws2 to ws3. ' Now you can...
I believe the problem is that you are not getting the sFileName from the original workbook. So I have added ActiveWorkbook.Save...
Hello Ready2go This may only answer some of your question. The macro below will create a PDF file of Sheet2....
Dear Hyside2, I really appreciate your cooperation and helpful answer. Thanks so much.
Try this instead =IFERROR(LEFT(B1,FIND(" ",B1)-1),B1) [img alt_text='' description='']http://vbaf1.com/q/wp-content/uploads/2018/08/givenname.png[/img]
I am not sure if this is what you are looking for but test it out anyway. [img alt_text='' description='']http://vbaf1.com/q/wp-content/uploads/2018/08/1-2.png[/img]...
Oh! Please try this. You will need to change "Book1" on the line that reads (oFilename="Book1") to the name of...
I have a worksheet “Sheet1”with one of the colums “EID”. I want to search for a value in this column and if found want to copy and paste the whole row in another worksheet “Sheet2” in a particular line. Say in line 4, over writing the data if any in line 4 .
I need a macro please.
Here is the required macro to search a field and if value found copy the whole row into another worksheet.
Dim lstRow_Sht1 As Integer, lstRow_Sht2 As Integer, iCnt As Integer, jCnt As Integer
Dim Sht1 As Worksheet, Sht2 As Worksheet
Dim srchField As String
Set Sht1 = Sheets("Sheet1")
Set Sht2 = Sheets("Sheet2")
'Find last row in sheet1
lstRow_Sht1 = Sht1.Cells(Sht1.Rows.Count, "A").End(xlUp).Row
'Find last row in sheet2
lstRow_Sht2 = Sht2.Cells(Sht2.Rows.Count, "A").End(xlUp).Row
'Enter search field
srchField = InputBox("Enter Search Field", "Find Field")
'Loop through all rows in sheet1
For iCnt = 2 To lstRow_Sht1
'lets assume EID is available in column A in Sheet1
If Sht1.Range("A" & iCnt) = CInt(srchField) Then
For jCnt = 1 To lstRow_Sht2
'lets assume EID is available in column A in Sheet2
If Sht2.Range("A" & jCnt) = srchField Then
'If field is available then update existing data
Sht1.Rows(iCnt).Copy Destination:=Sht2.Range("A" & jCnt)
If jCnt = lstRow_Sht2 Then
'If field is not available then add after the last record
Sht1.Rows(iCnt).Copy Destination:=Sht2.Range("A" & jCnt + 1)
If iCnt = lstRow_Sht1 Then
'If search field is not available in sheet2 then display message
MsgBox "Search Field is not available."
Hope, It resolves your problem.
Regret the delay in response.
this is the data
EID NAME PAY PayDay
14123 Joe1 $1,234.00 29-Jun-17
14124 Joe2 $1,235.00 29-Jun-17
14125 Joe3 $1,236.00 29-Jun-17
14126 Joe4 $1,237.00 29-Jun-17
14127 Joe5 $1,238.00 29-Jun-17
14128 Joe6 $1,239.00 29-Jun-17
14129 Joe7 $1,240.00 29-Jun-17
14130 Joe8 $1,241.00 29-Jun-17
14131 Joe9 $1,242.00 29-Jun-17
14132 Joe10 $1,243.00 29-Jun-17
14133 Joe11 $1,244.00 29-Jun-17
14134 Joe12 $1,245.00 29-Jun-17
14135 Joe13 $1,246.00 29-Jun-17
EID NAME PAY PayDay
If you could make it work.
Thanks I got it working…
Please share using the share button above.
If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.
Found the answer useful and wants to credit the user, then vote the answer (vote up).