Prev: VBA vocabulary
Next: convert .123 file
From: Dave Peterson on 3 May 2010 08:37 Either your names aren't what you think they are (a typo or two???). Or maybe Sheet4 is the CodeName of the sheet--not the name the user sees on the sheet tab at the bottom of the screen in Excel???? Set myCell = Sheet4.Range("StaffHeader1") (Check to see if that last character in staffheader? is really a one or an ell, too.) Isis wrote: > > Dave Peterson <petersod(a)verizonXSPAM.net> wrote in news:4BDEBBBD.B7AF3490 > @verizonXSPAM.net: > > > msgbox mycell.column > > > > > > Dave, > > I am obviously doing something wrong as this code; > > Dim myCell As Range > Set myCell = Worksheets("Sheet4").Range("StaffHeader1") > MsgBox myCell.Column > > gives me a "subscript out of range error" > > Any ideas ? > > Thanks > > PS I have a Sheet4 and StaffHeader1 is a named cell on that sheet -- Dave Peterson
From: Don Guillett on 3 May 2010 08:44
Try? Sub whichcolofnamedrng() MsgBox Range("mydefinedname").Column End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett(a)gmail.com "Isis" <isissoft(a)NOSPAMbtinternet.com> wrote in message news:Xns9D6D81154696Disissoft(a)91.208.207.62... >I have named a cell on sheet - how doe I reference just the column property > of that named cell in vba on another sheet in the same workbook please ? > > > Thanks |