VBA / Macro - use a cell info for find command on different workbook to copy data to other workbook

CrashOD

Board Regular
Joined
Feb 5, 2019
Messages
118
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
I have two work books I am working out of.
1. RLE_County Local 2022.xls
2. 2022 Tax Certification Form.xlsm (Macro in this one)

I am look at how to take data from 2022 Tax Certification Form.xlsm sheet "2022 TAX CERTS LIST" last column that has data for a search.

I know for last column for B that has data and to copy it.
Sheets("2022 TAX CERTS LIST").Select
Range("B" & Rows.Count).End(xlUp).Select
Selection.Copy

I want to take in info and search RLE_County Local 2022.xls (has only one sheet) and when finds that match which is in column P.
so i want to take data in the row from A & R
put "A" data
2022 Tax Certification Form.xlsm
Sheets("2022 TAX CERTS LIST").Select
in first empty cell in column in C (next to B were it got the parcel to search)

then "R" data in D
attached pictures to help hopefully

below is code i use to copy data from same workbook tax cert from one sheet to another. dont know if it will help you or not. but thanks for any help i can get.

Sub Tax_Copy_List_to_Bill()
'
' Tax_Copy_List_to_Bill Macro
'
' Keyboard Shortcut: Ctrl+q
'
Sheets("2022 TAX CERTS LIST").Select
Range("B" & Rows.Count).End(xlUp).Select
Selection.Copy
Sheets("Tax Cert Bill").Select
Range("B21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("2022 TAX CERTS LIST").Select
Range("C" & Rows.Count).End(xlUp).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tax Cert Bill").Select
Range("B22").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("2022 TAX CERTS LIST").Select
Range("D" & Rows.Count).End(xlUp).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tax Cert Bill").Select
Range("B23").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("2022 TAX CERTS LIST").Select
Range("E" & Rows.Count).End(xlUp).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Tax Cert Bill").Select
Range("B15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Tax Cert 2022-2021").Select
Workbooks("RLE_County Local 2022.xls").Activate
'Windows("RLE_County Local 2022.xls").Activate
' Cells.Find(What:="009-01-001-053", After:=ActiveCell, LookIn:=xlFormulas _
' , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
' MatchCase:=False, SearchFormat:=False).Activate
End Sub
 

Attachments

  • 2022 Real.png
    2022 Real.png
    35 KB · Views: 6
  • 2022 Tax Certification Form.png
    2022 Tax Certification Form.png
    20.8 KB · Views: 6

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I got a search code to work. now how do i take data from R and A in same row to put value in workbook East Cameron Township - Copy.xlsm sheet List next empty cell in C (were data from A goes) and D (from cell R)

Sub Find_First()
Dim FindString As String
Dim Rng As Range
Workbooks("East Cameron Township - Copy.xlsm").Activate
FindString = Sheets("Tax Cert Bill").Range("B17").Value

Workbooks("2022 - ECT - Real Estate - Copy.xls").Activate

If Trim(FindString) <> "" Then
With Sheets("Real Estate").Range("P:P")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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