Rodney, Thanks for the help, but I'd like to be able to call this subroutine from a cell. Is that possible? For instance have cell B2 be =ChangeCell (A1:A5).
LookingForExceHelp On Mar 28, 6:27 pm, rspowell <rod...@beyondtechnology.com> wrote: > Hello Friend -- > > You need a subroutine to change the range ... > > Sub ChangeCells(theRange As Range) > > theRange.Cells(1,1) = "Hello World" > > End Sub > > ... this will work fine > > Hope it helps you ! > > - Rodney POWELL > [ Microsoft MVP - Excel, 1997-2009 ] > > www.BeyondTechnology.com > > On Mar 28, 11:05 am, LookingForExcelHelp <ahar...@gmail.com> wrote: > > > > > All, > > > I have a simple task: I'd like to modify the value in a cell in a > > range of cells, which is passed in to a function. > > > For example: > > > Function ChangeCells(theRange As Range) > > > theRange.Cells(1,1) = "Hello World" > > > End Function > > > If I run this function, I always receive the #VALUE! error message. I > > can read the value from the cells in the range. However, If I do > > > Debug.Print theRange.Cells(1,1) > > > it will properly print whatever is in cell 1,1 of the given range. > > > Any help is appreciated.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---