PC Review


Reply
Thread Tools Rate Thread

Active Cell Filling

 
 
=?Utf-8?B?U2FmaS4=?=
Guest
Posts: n/a
 
      21st Apr 2007
Hi,
I wanted to have control over the files present in my hard drives..My Date
is 3 columns A,B,C. column A has drive name Column B has short discription of
file and Column C will have the names of files..to fill in column c i have
used this VBA code.



Sub Filenames()
Dim FName As Variant
If Application.ActiveCell.Address = "$C$2" Then

FName = Application.GetOpenFilename(filefilter:="All Files, *.*) *.*")
If FName <> False Then
Worksheets("Sheet1").Cells(5, 3).Value = FName
End If
End If
End Sub

My Requirement is that when ever i click on any cell in column c. the above
code have to run and fill the complete file name in that cell. like this
automatically moves to next cell and next cell to fill up column C...plz help
on this.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      21st Apr 2007
Not sure what you mean but put this into the sheet1 module

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell = Range("C2") Then
Run "Filenames"
End If
End Sub

"Safi." wrote:

> Hi,
> I wanted to have control over the files present in my hard drives..My Date
> is 3 columns A,B,C. column A has drive name Column B has short discription of
> file and Column C will have the names of files..to fill in column c i have
> used this VBA code.
>
>
>
> Sub Filenames()
> Dim FName As Variant
> If Application.ActiveCell.Address = "$C$2" Then
>
> FName = Application.GetOpenFilename(filefilter:="All Files, *.*) *.*")
> If FName <> False Then
> Worksheets("Sheet1").Cells(5, 3).Value = FName
> End If
> End If
> End Sub
>
> My Requirement is that when ever i click on any cell in column c. the above
> code have to run and fill the complete file name in that cell. like this
> automatically moves to next cell and next cell to fill up column C...plz help
> on this.

 
Reply With Quote
 
=?Utf-8?B?U2FmaS4=?=
Guest
Posts: n/a
 
      21st Apr 2007
Hi.

Sorry I wud not put up a meaningful query. But Wat I wanted is that when I
click any cell in a Column C > the filepick dialog shuld open > and the
selected file fills up that cell>Cell moves to next column, then I will clik
the cell just below which will repeat the above and fills up the file
selected the active cell moves to another column(which makes code stop) ..and
to fill up again i will clik the next below cell in column C only like this
this will continues..upto when i stop clicking the cells in column C.


"Mike" wrote:

> Not sure what you mean but put this into the sheet1 module
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>
> If ActiveCell = Range("C2") Then
> Run "Filenames"
> End If
> End Sub
>
> "Safi." wrote:
>
> > Hi,
> > I wanted to have control over the files present in my hard drives..My Date
> > is 3 columns A,B,C. column A has drive name Column B has short discription of
> > file and Column C will have the names of files..to fill in column c i have
> > used this VBA code.
> >
> >
> >
> > Sub Filenames()
> > Dim FName As Variant
> > If Application.ActiveCell.Address = "$C$2" Then
> >
> > FName = Application.GetOpenFilename(filefilter:="All Files, *.*) *.*")
> > If FName <> False Then
> > Worksheets("Sheet1").Cells(5, 3).Value = FName
> > End If
> > End If
> > End Sub
> >
> > My Requirement is that when ever i click on any cell in column c. the above
> > code have to run and fill the complete file name in that cell. like this
> > automatically moves to next cell and next cell to fill up column C...plz help
> > on this.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling a Cell with Yellow backgound after testing for -ve cell d Chris Maddogz Microsoft Excel Programming 2 8th Oct 2009 10:18 PM
Filling a cell with formula only if cell in the column to the left isfilled Raj Microsoft Excel Programming 3 25th Apr 2009 12:57 PM
filling information from one cell and filling another. =?Utf-8?B?RGlhbm5l?= Microsoft Excel Worksheet Functions 1 15th Aug 2005 08:14 PM
FILLING ACTIVE X CONTROL HELP dk Microsoft Access 0 3rd Feb 2005 07:12 AM
Filling down from active cell =?Utf-8?B?TmVhbA==?= Microsoft Excel Programming 0 3rd Nov 2004 12:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.