LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Browse the .CSV file import data from that CSV file into maste

i don't have access to excel just now, but try this

Private Sub CommandButton12_Click()
With Worksheets("ENTITY")
.Columns("C").SpecialCells(xlCellTypeBlanks).Entir eRow.Delete
.Columns("D").SpecialCells(xlCellTypeBlanks).Entir eRow.Delete
End With
End Sub

"Deen" wrote in message
...
Hi Patrick

Its working great, I treat you. Thank you very much.

And patrick i have facing one more problem, See below in that command
button
script is in userform command button, in entity sheet C&D column is have
any
blank cell need to delete the entire row,

But is shows the error in that line "Selection.EntireRow.Delete"

Error like : Run time error '1004'
Cannot use that command on overlapping selections.


Private Sub CommandButton12_Click()
Worksheets("ENTITY").Activate
Columns("C:D").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
End Sub







"Patrick Molloy" wrote:

here's the demo

on a userform
place three controls
textbox , name:= txtFileName
commandbutton, name:= btnBrowse, caption: Browse...
commandbutton, name:= btnOpen, caption:= Open

add this code:=

Option Explicit
Private Sub btnBrowse_Click()
Dim sPath As String
sPath = "C:\temp\" 'whatever you need
ChDir sPath
txtFileName = Application.GetOpenFilename("CSV Files (*.csv),
*.csv)")
End Sub
Private Sub btnOpen_Click()
If txtFileName.Text = "" Then Exit Sub
If Dir(txtFileName.Text) = "" Then Exit Sub
FetchData
End Sub
Private Sub FetchData()
Dim wb As Workbook
Set wb = Workbooks.Open(txtFileName.Text)
wb.ActiveSheet.Cells.Copy
ThisWorkbook.Worksheets("entity").Range("a1")
wb.Close False
End Sub


How it works...
user can either type in the full name into the text box or click the
browse
button. when the browse button is clicked the full path and name of the
selected file is placed into the textbox
if the user is ok with this, press the Open button.
the csv file is opened and the activesheet copied to the worksheet called
entity



"Deen" wrote in message
...
Hi Patrick,

I hope you are doing well,

I have 1 more doubt, In my user form ihave the command button called
browse
the data. once i click the button need to browse windows open to search
the
.CSV once i select the particular csv file click open, Automatically
data
will copy(import) and paste in to the master excel, in that worksheet
name
called entity.

Could you please help me on this.


Thanks in advance

Deen

 
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
Data Validation: Store cell address instead of value in the cell? WillW Excel Discussion (Misc queries) 1 January 31st 07 02:22 AM
Store cell data in a variable snowing[_2_] Excel Programming 1 May 28th 06 07:04 PM
How to store custom data into Excel cell [email protected] Excel Programming 0 March 7th 06 12:27 PM
Unsing names to store input from Userforms Pavlos Excel Programming 4 September 10th 04 12:51 PM
Store Hidden Data in the Cell Yishi Excel Programming 2 December 12th 03 11:57 AM


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

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

About Us

"It's about Microsoft Excel"