Hi Robin,
You can import the file name into any cell with the following formula:

=MID(CELL("Filename"),SEARCH("[",CELL("Filename"),1)+1,LEN(CELL("Filename"))-1-SEARCH("]",CELL("Filename"),1))

I'm sure that there's a shorter single-formula method, but I can't think of it 
just now.

Waiting for your sample workbook.

Regards - Dave.



This

> Date: Sun, 31 May 2009 02:15:53 -0700
> Subject: $$Excel-Macros$$ Re: read saved file name and put a digit in a 
> column  range ????
> From: mail2rbhand...@gmail.com
> To: excel-macros@googlegroups.com
> 
> 
> HI
> so can u tell me how will u import file name in tha same sheet ... i
> am doing +cell("filename") but this is giving whole path but i just
> need file name...??
> 
> On May 31, 12:18 pm, robin_suv <mail2rbhand...@gmail.com> wrote:
> > hi Dave,
> >
> > thanks for ur replay, well yes its very confusing, i have a file name
> > AXN which is having some data inside with column A, B, C, now there is
> > another file (or a sheet2 of AXN) with two column A, B which says
> > channel name and channel code and data in it is AXN and 234 and other
> > such channel name and its code like sony 123  in A & B column
> > (sheet2) , now i do not have any column in AXN file which says channel
> > name, but i want channal code in column D of it with refrence of
> > sheet2 which carry channel name and its code, i am not able to use
> > Vlookup in this case due to no such column in AXN which says channel
> > name, i have 347 such files ... and i am doing it manualy to put
> > codes in col D of  AXN and other files.... SENDING U the sample
> > file ....
> >
> > Thanks,
> > Robin
> >
> > On May 30, 6:37 pm, Dave Bonallack <davebonall...@hotmail.com> wrote:
> >
> >
> >
> > > Hi Robin,
> > > I have tried to understand your needs, but cannot.
> > > 1. "a macro which will read my file name"
> > >    This we can do.
> > > 2. "i want that my macto add a
> > > column D and reads my saved file name and put a digit 25 in that D
> > > coulmn in range d1 to d last (till column A, B, C, carries data) ??"
> > >    This I don't understand.
> >
> > > If you provide a sample workbook, with specific instructions in that 
> > > workbook, we may be able to help.
> > > Regards - Dave
> >
> > > > Date: Fri, 29 May 2009 22:27:48 -0700
> > > > Subject: $$Excel-Macros$$ read saved file name and put a digit in a 
> > > > column range ????
> > > > From: mail2rbhand...@gmail.com
> > > > To: excel-macros@googlegroups.com
> >
> > > > hi friends, i am looking for a macro which will read my file name
> > > > (saved file where i will run macro) and print a code in given range of
> > > > a column, for an example if my file name is test (saved in desktop) is
> > > > carring some data in column A, B, and C, i want that my macto add a
> > > > column D and reads my saved file name and put a digit 25 in that D
> > > > coulmn in range d1 to d last (till column A, B, C, carries data) ??
> >
> > > > please help me out with this, i am having 256 such files and i need to
> > > > do it manually every day, which is very fustrating...  please give
> > > > some idea of this macro code atlest,
> >
> > > > Thanks,
> > > > Robin
> >
> > > _________________________________________________________________
> > > View photos of singles in your area Click 
> > > Herehttp://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Eninemsn%2Eco...Hide
> > >  quoted text -
> >
> > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
> 
> > 

_________________________________________________________________
View photos of singles in your area Click Here
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Eninemsn%2Ecom%2Eau%2Fsearch%2Fsearch%2Easpx%3Fexec%3Dgo%26tp%3Dq%26gc%3D2%26tr%3D1%26lage%3D18%26uage%3D55%26cl%3D14%26sl%3D0%26dist%3D50%26po%3D1%26do%3D2%26trackingid%3D1046138%26r2s%3D1&_t=773166090&_r=Hotmail_Endtext&_m=EXT
--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to