Hello,
This is my first time on this site and I am hoping someone can help me. Here is my problem...
I have multiple CSV's stored on my computer (c:/desktop/Tech Folder). I would like the option to select a CSV from a drop down box (cell A1). I was thinking that maybe this cell could automatically refresh when a CSV is transferred to this comunity folder of all my CSV reports.
Afterwards, Once this CSV is selected I would like a macro (ctrl + shift + Q) to input that in cell C6. (CSV: delimited, comma, begin with row 6, remove last column) Once this is entered the graphs will automatically generate.
Bonus points if anyone knows how automatically scale a graph to the data points listed in the table (smaller graph for smaller data points, larger graphs for larger datapoints)
Here is what I have so far for my import macro, but it only imports the one CSV I specify.
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+Q
'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\MYNAME\Desktop\Tech Folder\UPSCF0.CSV", Destination:= _
Range("$C$14"))
.Name = "UPSCF0"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 6
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
ActiveWorkbook.Save
End Sub
Much gratitude to all who attempt this problem!
Chris![]()
Bookmarks