Does anyone know why in VBA for excel, why I cannot write a value to a cell
in a function, but I can in a sub without arguments? Is this a bug? For
example;
Public Function w(x As Double) As Double
Range("A1").Value = x
End Function
does not work. Whereas;
Public Sub w()
Range("A1").Value = 3.23
End Sub
Does work.
So, inside a function, how can I write to a cell? I appreciate your help.
Re: Passing excel objects to subroutines as parameters ... finds a specified cell value on an excel spreadsheet and then ... formats the found cell and inserts text next to the found cell. ... statement the code simply exits the sub routine and proceeds with ... What I go by when automating, I can play with the stuff in the ... (microsoft.public.access.modulesdaovba)
Re: Passing excel objects to subroutines as parameters ... finds a specified cell value on an excel spreadsheet and then formats ... the found cell and inserts text next to the found cell. ... The sub is ...Set rng = Ws.Range'.Address ... (microsoft.public.access.modulesdaovba)
Re: SendKeys "(^ {HOME})" ... I've tried the following combos of VBA and Excel 2000 v9.0.2720 Application. ... right Cell being the only Cell in the lower, ...Public Sub SelectLoRtPaneUpLfCell()...Dim lUpLfPaneMaxColNum As Long ... (microsoft.public.excel.programming)
Re: Passing excel objects to subroutines as parameters ... finds a specified cell value on an excel spreadsheet and then formats ... the found cell and inserts text next to the found cell. ... The sub is ...Dim xlApp As Excel.Application ... (microsoft.public.access.modulesdaovba)
Re: how to change a cell content in a visual basic function? ...Private Sub Worksheet_Change ... It looks to see if you changed A1, if it's some other cell, it gets out. ... Then it continues through the error handler and tells excel to start looking for ... Rightclick on the worksheet tab that should have this behavior. ... (microsoft.public.excel)