Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Active Cell Filling

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Active Cell Filling


Code:
--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Union(Range("$C:$C"), Target).Address = Range("$C:$C").Address Then
MsgBox Target.Address ' this is where you coe goes
End If
End Sub

--------------------


--
davesexcel
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Active Cell Filling

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Active Cell Filling

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 cellCell 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Active Cell Filling


Thats what the code does....
anywhere in column C the code activates


--
davesexcel
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
referring to formula in a non active cell from active cell nickname Excel Discussion (Misc queries) 1 June 21st 07 12:11 PM
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
filling information from one cell and filling another. Dianne Excel Worksheet Functions 1 August 15th 05 08:14 PM
Filling down from active cell Neal Excel Programming 0 November 3rd 04 12:26 AM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"