IF function referencing a range of cells and sheets

mwgrace

New Member
Joined
May 8, 2015
Messages
3
Hello,
I am setting up an expenses tracker for myself each month has it's own sheet and I have the last sheet tracking my Visa bill.
What I want is if the Value in Column I in any of the sheets is "Visa" then copy the value in cell K to column E in the Visa Sheet in the form of a list. For example if May!I2=Visa then copy value of May!K2 to Visa!ColumnE I would like to be able see the individual transactions.
I have a few more questions but I'll stick to just this one for now.
Thanks!
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Something along the lines of

Dim ws As Worksheet
Dim c As Range, rng
Dim lastrow As Long
Dim visa_val As Long


For Each ws In ThisWorkbook.Worksheets

If ws.Name <> "Visa" Then
ws.Activate
lastrow = Cells(Rows.Count, "i").End(xlUp).Row
Set rng = Range("I2:I" & lastrow)

For Each c In rng

If c.Value = "Visa" Then
visa_val = c.Offset(0, 2).Value

Sheets("visa").Activate
lastrow = Cells(Rows.Count, "k").End(xlUp).Row + 1
Range("k" & lastrow) = visa_val
End If
Next c

End If
Next ws
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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