I need syntax help on this one. I have created a integer variable called totalData to hold the # of rows with data. Now I want to format the rows, so I am using
Rows("5:totalData").Select But i cannot use the "totalData" in the rows function.
Can someone please help me figure out a way that I can select all of these rows so I can format them with the correct size and font.
THANKS.
Rows("5:" & totalData).Select
Note totalData must be > 0
Note I only added a note because stackoverflow said the answer was too short.
Related
Using COUNTIF to count the number of times the value "HW or SW" shows up in a column. I am not sure how many rows of data I will end up with so I want to make that a variable, using INDIRECT. This formula returns a #VALUE error and I cannot figure out why: =COUNTIF('Daily_Data_Dump'!$G$2:INDIRECT("$G"&AB3),"HW_or_SW") Where the value in cell "AB3" is 5000. In my mind is should be the equivalent of =COUNTIF('Daily_Data_Dump'!$G$2:$G5000,"HW_or_SW"). Thanks for any help.
"In my mind is should be the equivalent of =COUNTIF('Daily_Data_Dump'!$G$2:$G5000,"HW_or_SW")."
That is correct, the problem is something else. The adress is wrong, try:
=COUNTIF('Daily_Data_Dump'!$G$2:INDIRECT("Daily_Data_Dump!$G"&AB3),"HW_or_SW")
I have a long list of data, one line for one movement. I need to check the volumes of the movements by location. The locations can be grouped, as some of them has the same criteria for filtering. For doing that I would like to read the cell values into a list and then looping through the original list of data by checking into which group does the location belongs. I don't know how to read the group into a list in a way that then I can check if a cell value matches with any of the items in the original - to be filtered - list.
Can anyone help with it? Also, in case you have any other suggestion for the solution, I appreciate it too.
Thanks!!
Please provide us your own solution or at least a attempts to present your effort. Without any data or code to analyze I can suggest sth like this:
Sub Make_a_List()
Dim TableWithData() as Variant
TableWithData = Range(Cells(1,1),Cells(100,100)) 'Values as example
End Sub
This gives you an table with elements of the specified range. For one row you will get one dimension table.
Then for instance you can make a for loop:
For i=1 to Ubound(TableWithData)
if TableWithData(i) = sth then
do whatever you need
end if
Next i
I was hoping that there is a way to conditionally format the column G like columns B & C. Possibly as binary, where the text = 1 and blank = 0? Thanks in advance.
Not exactly know the logic but here is a way to accomplish this with tweaking Custom Number Format. Here is the example and how I do it:
Determine your logic. See what I have in my example. I simply used 0 and 1 because Conditional Formatting works better with numbers.
Right click on the cell on column G, make a rule like [=0]"FAIL";[=1]"OKAY". Values inside [ ] is the condition, and the output string is inside the double quotes " ".
As for the Conditional Formatting, I believe you know what to do. Please let me know if this helps and good luck.
I have this statement nested in an IF-Statement under a scenario. I would like it to format column 2 into a Accounting number without decimal places. How can this be done using VB.net? The current code gives me ex: 1,000,000.00 on an input of 1000000. I noticed excel has buttons for adding or subtracting decimal places. Could these be called within VB.net? Thanks!
Lo.ListColumns("Column2").DataBodyRange(CurrentRow).NumberFormat = "ACCOUNTING"
Try the following
Lo.ListColumns("Column2").DataBodyRange(CurrentRow).NumberFormat = "#0,000.00"
You may find help in this Article
From what i understand you want, you can do:
math.floor(*insert the value or variable you want here*)
What that does is it changes the number in the parameter to the biggest integer lower than the parameter.
Hope this works :)
I tried to use SUMIFS, but it failed since the formula doesn't allow me to use two different criterias from the same criteria range (which makes sense of course), so I looked around the Internet and found '=SUMPRODUCT' instead I used it but it doesn't return any value. Here my formula
=SUMPRODUCT((('BB_Juni 2016_Crew'!E:E="DB")+('BB_Juni 2016_Crew'!E:E="DZ"))*('BB_Juni 2016_Crew'!G:G))
Maybe Looping through the range with an if clause and using the sum function after "then"?
In row number 26 & 27 are two different string values ("DB,DZ") and in the same row is a value in the column (Betrag) which means amount and I need a formula to sum all values that are in the same rows as "DB" and "DZ"
I agree with Jeeped that you should "Cut your full column references down to the actual extents of your data"
There is a slight typo in your formula. Replace the * with a , and it will work just fine :)
Your original formula should be
=SUMPRODUCT((('BB_Juni 2016_Crew'!E1:E6="DB")+('BB_Juni 2016_Crew'!E1:E6="DZ")), 'BB_Juni 2016_Crew'!G1:G6)
Replace 6 with the relevant row.
This is the best I can improve your existing formula without more information.
=SUMPRODUCT(('BB_Juni 2016_Crew'!E1:INDEX('BB_Juni 2016_Crew'!E:E, MATCH("zzz", 'BB_Juni 2016_Crew'!E:E))={"DB","DZ"})*('BB_Juni 2016_Crew'!G1:INDEX('BB_Juni 2016_Crew'!G:G, MATCH("zzz", 'BB_Juni 2016_Crew'!E:E))))
It may look more complicated but it actually performs much less work.
Actually, this may be even better.
=SUM(SUMIFS('BB_Juni 2016_Crew'!G:G, 'BB_Juni 2016_Crew'!E:E, {"DB","DZ"}))
Both are standard formulas (no need for CSE).
There is a spreadsheet function AND that accepts several conditions and returns TRUE of all conditions are TRUE, FALSE otherwise.
You may try re-phrasing your formula or make your question clearer so it may be possible to give you an actual working formula.