Using If statement to pull data from adjacent cell in a range of cells then copying to another seet

TM61404

New Member
Joined
Sep 22, 2015
Messages
3
Hello, I am working with a report where i need to sort through associates names/different job positions/titles in a table in columns 2&3 THEN copy column twos values and add it to its designated spot(next empty row) based on that associates job title. the vba that i have pieced together does just that but i wanted to know if there was a way to make a range of cells the value? or should i be using another formula for what i am trying to do. so to be clear the issue is that on a day to day basis we will refresh these names and descriptions with new ones so it does not help for the formula to be tied to one specific value. ANY HELP WOULD BE GREATLY APPRECIATED.


Dim DELI_CLERK As String
Dim finalrow As Integer
Dim i As Integer 'ROW COUNTER

Sheets("Mon").Activate
DELI_CLERK = Sheets("MON").Range("c6").Value
finalrow = Sheets("MON").Range("c31").End(xlUp).Row

For i = 2 To finalrow
If Cells(i, 3) = DELI_CLERK Then
Cells(i, 2).Copy
Sheets("DEPT").Range("h46").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats

End If

Next i

End Sub
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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