Re: Date string and date serial number manipulation in VBA
Interesting. I'll give it a try.
Re: Date string and date serial number manipulation in VBA
Interesting. I'll give it a try.
Re: Make VBA cell references auto-update as spreadsheet changes
bump
I want to pass in the date in a serial # format and be able to change it back & forth from serial # to date string in the code. I have not been able to get any conversions in VBA to work.
Re: Add positive only and Negative only into one cell.
I hadn't thought of sumif. That is a good idea.
Re: Add positive only and Negative only into one cell.
Do you want to have a sum total at the bottom of the pos & neg columns or keep a running total? Keeping a running total might be tough with the way I have in mind.
Re: Add positive only and Negative only into one cell.
Do you want to do this in VBA or in normal formulas?
I want to make my VBA cell reference update when I update my spreadsheet by adding or deleting columns or rows. Is there a way to do this?
Re: Using indexing and cells() property to reference cells in VBA.
That worked great. Thanks so much for your help.
Re: Using indexing and cells() property to reference cells in VBA.
I am such a goober....
Re: Using indexing and cells() property to reference cells in VBA.
Any ideas why it would be returning empty & not erroring out? Can anyone provide a working example of workbooks.sheets.cells...?
Help!
Re: Using indexing and cells() property to reference cells in VBA.
Well at least that doesn't error out. It still doesn't pull a value though. When I debug & let the last line complete I get show that it is returning "empty".
I am trying to use VBA to write my own function in Excel. I want to pass in a string & do mulitple lookups in a table based on the string.
Function transCost(mileage, companyCode)
Dim x As Integer, y As Integer
For Each i In Workbooks("Lift Master Spreadsheet.xls").Sheets("vend").Range("a1:bz1")
x = x + 1
If i = "1mba" Then '1mba is a column header
Exit For
End If
Next
For Each i In Workbooks("Lift Master Spreadsheet.xls").Sheets("vend").Range("b1:b100")
y = y + 1
If i = companyCode Then 'companyCode is a row header.
Exit For
End If
Next
transCost = Workbooks("Lift Master Spreadsheet.xls").Sheets("Vend").Range(Cells(x, y)).Value
End Function
Display More
I cannot get the very last line to pull anything. The index values coming up correctly. It seems to be the syntax that is not working but everything that I look up tells me that my syntax is fine.
Any suggestions!?!?!?: confused: