Trying to Find specific values in 'other' worksheets

Status
Not open for further replies.

ca11059

New Member
Joined
Sep 15, 2011
Messages
7
Hi, I am trying to locate a specific value (using FIND) in a different ws and then need to get the ROW info so I can grab data from cells in that row to populate in my active worksheet... I pasted the code I'm working with below, but I am guessing at how to get the row info and have been unable to find it..

Also, sorry I don't know how to paste the code so neatly like everyone else does!




Dim LastRw As Long, Rw As Long, Cnt As Long, CrntRw As Long, R As Long
Dim dSht As Worksheet, dSht2 As Worksheet, dSht3 As Worksheet, tSht As Worksheet, Tst As Worksheet
Dim MakeBooks As Boolean, SavePath As String
Dim Acct As String
Dim wtf As Range

Application.ScreenUpdating = False 'speed up macro execution
Application.DisplayAlerts = False 'no alerts, default answers used

Set dSht = Sheets("GroupMembership-Aug") 'sheet with data on it starting in row2
Set dSht2 = Sheets("CertAssign")
Set dSht3 = Sheets("ACTIVEACCOUNTS")
Set tSht = Sheets("Template") 'sheet to copy and fill out
Cnt = 0

'Determine last row of data then loop through the rows one at a time
LastRw = dSht.Range("A" & Rows.Count).End(xlUp).Row

For Rw = 2 To LastRw
Acct = dSht.Range("E" & Rw)

On Error Resume Next
Set Tst = ActiveWorkbook.Worksheets(Acct)
'Verify that the proposed sheet name does not already exist in the workbook.
If Tst Is Nothing Then

tSht.Copy After:=Worksheets(Worksheets.Count) 'copy the template
With ActiveSheet 'fill out the form
'edit these rows to fill out your form, add more as needed
.Name = Acct
.Range("E2").Value = dSht.Range("B" & Rw).Value
.Range("B2").Value = dSht.Range("F" & Rw).Value
.Range("H2").Value = dSht.Range("C" & Rw).Value


Set wtf = dSht3.Range(AcctDesc).Find(Acct)
R = wtf.Row

.Range("B4").Value = dSht3.Range("I" & R).Value


Thanks so much..
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Status
Not open for further replies.

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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