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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

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