Excel Sum another sheet with Indirect - sum

To sum data from another sheet, I use:
=SUM('SHEETNAME'!A1:A2)
However, I can't figure out how to sum data from another sheet if I use INDIRECT function with it.
I tried:
=SUM('SHEETNAME'!INDIRECT(CONCATENATE("E",C11)):INDIRECT(CONCATENATE("D",C11)))
The CONCATENATE data is on active sheet. I just need the SUM data from another sheet.

Please try:
=SUM(INDIRECT("SHEETNAME!E"&C11&":D"&C11))

Related

Trying to get the Column Values in 1 sheet to other sheet in Row with Dynamic Updation from 1st sheet

I have been trying to get the above data which is presented datewise in Column form to be pasted in the below format in Row form, but challenge is either 1 date at a time can be taken or either single cell reference needs to be given in each cell on other sheet, need some shortcut such that sheets data remains dynamic and datewise data is copied. Image shows it in one sheet, above data is required to be shown in below format in other sheet.
Thanks and Regards
Mandeep Goraya
For example, your table is like this:
Put this code into cell B8 then fill right:
=INDEX($B$2:$F$3,MOD(COLUMN(A1)-1+ROWS($B$2:$F$3),ROWS($B$2:$F$3))+1,1+INT((COLUMN(A1)-1)/ROWS($B$2:$F$3)))

How to select only cells with values on different sheets, without switching over to that sheet?

I currently have a macro that copies and paste data from one sheet to another sheet, based on a certain criteria. I have over 15 sheets that it does this.
Now what I want to do is select all the data in the new sheets, and turn it into a table.
I know I can use ActiveSheet, but I would need to do that for every single sheet. Is there a way I can select only the data in other sheets, without that being my active sheet?
I am able to select all my data in an active sheet with this:
ActiveSheet.Range("B1:M1", ActiveSheet.Range("B1:M1").End(xlDown)).Select
I tried doing something like below, but just selects the last cell with data in it. If I remove the .End(xlDown), then it will select B1:M1.
Application.Goto Sheets("SheetName").Range("B1:M1").End(xlDown)
Any idea if there is a way to copy my data in those ranges without switching tabs?
Thank you!
You can avoid Select/Selection/Active/ActiveXXX, like follows:
With Sheets("SheetName")
.Range("B1:M1", .Range("B1:M1").End(xlDown)).Copy Destination:= someotherrange
End With
Where someotherrange is a valid range reference where to paste copied data into

How to copy selected columns and filter them before hand in excel VBA

I am just a beginner in VBA. I am trying to copy some data from one workbook that is updated daily to a master woorkbook and generate a report. I want it to first filter one of the columns for nonzero values and copy it with three selected columns for example columns T,C,N. I have looked everywhere for an answer but I haven't succeeded yet. Please help.
You can check if a given cell has value 0 by something like this If Sheets(sheetname).Cells(rownumber,columnnumber)=0 Then
You haven't specified what do you want to do on the other workbooks with the cells that were empty.

Changing Formula sheet reference with Macro

Hello everyone i'm new to this site! i wanted to see if anyone could assist with a concept i believe is possible but don't know how to achieve it.
Essentially i have a formula that has Vlookups and references other sheets, this formula is the same but the sheet referenced changes for each column as each column references a different sheet. this is going to be done 135 times over 8 times.
=IF((IFERROR(VLOOKUP(D3,'[2015_Big_Book_Communication_10_19_15.xlsx]**Credit P-1**'!$C$2:$O$5000,9,FALSE),"Not Scheduled"))=0,1,IFERROR(VLOOKUP(D3,'[2015_Big_Book_Communication_10_19_15.xlsx]**Credit P-1**'!$C$2:$O$5000,9,FALSE),"Not Scheduled"))
I want to use a macro to change the bolded sheet reference based upon a cell.
my idea is to have all the sheet names listed in a column and have the macro edit the equation for each row and then just paste the formulas transposed.
Is this possible?
Use the following formula:
=IF((IFERROR(VLOOKUP(D3,INDIRECT("'[2015_Big_Book_Communication_10_19_15.xlsx]"&H3&"'!$C$2:$O$5000"),9,FALSE),"Not Scheduled"))=0,1,IFERROR(VLOOKUP(D3,INDIRECT("'[2015_Big_Book_Communication_10_19_15.xlsx]"&H3&"'!$C$2:$O$5000"),9,FALSE),"Not Scheduled"))
In a column ("col H" in this example) write the sheet names and use indirect formula to refer to those names.

How To Display Excel rows on selection of first Excel Column Value

I have Two Excel sheets. My requirement is when I select a reason value from one Excel sheet Reason_Name column, it will display that reason value in a second Excel sheet.
So using Macro, I want to display the second Excel rows on selection of reason in first Excel.
Please Help.
This is the first Excel sheet - Reason_Name column contains Reason1, Reason2, etc.
alt text http://www.freeimagehosting.net/uploads/a10d6be7a5.png
This is the second Excel sheet
alt text http://www.freeimagehosting.net/uploads/99e0ff4cdb.png
Here's something that may get you started. (I think this is close to what you would like to do.)
Create a named range for the data on the second sheet. Named "new_range" in my example.
Then create the following procedure in a new module:
Sub FilterSheetTwo()
Worksheets("Sheet2").Range("new_range").AutoFilter Field:=6, Criteria1:="Reason1"
End Sub
When you run this procedure, it should filter the results on Sheet2.
You can then hook this procedure up to an Worksheet_Change event on Sheet1.
If you can sort your Reason column on the second sheet and place it as the left-most column you don't need a macro--you can do this using VLOOKUP. Steps:
Sort Data by your Reason column on the second sheet.
In each column of the first sheet enter the following formula:
=VLOOKUP(E2, DataRangeOfSheet2, ColumnYouWantFromDataRange)
See VLOOKUP for more info.