Creating SQL File Based Of Cells In A Sheet

Mar 27, 2014

I have a sheet that has 5 columns as shown below, xxx represents the values within the cell that I need in each sql file.

A |B | C| D| E
test1|xxx|xxx|xxx|xxx|
test2|xxx|xxx|xxx|xxx|
test3|xxx|xxx|xxx|xxx|
test4|xxx|xxx|xxx|xxx|
test5|xxx|xxx|xxx|xxx|

What I am trying to do is take the context of each cell starting with B2, and place it in an Individual sql file (or text file with .sql extension) and name it A2 (so test1 in this case).

I tried creating a double for loop, one for last column, one for last row, taking each content and placing in file but I am not sure how to take the column A as the name of the file and to have 1 file per cell.

View 9 Replies


ADVERTISEMENT

Creating A Summary Sheet Based On Other Sheets?

Jan 15, 2013

I have excel file in which each sheet will be filled by a different clients (Client1, Client 2, Client 3.. Client n).

Each sheet will have two columns "Description" and "Quantity". Client will add the descriptions and quantity.

Apart from the sheets filled by clients, the file will also have a sheet called "Summary".

After all clients filled, I need all distinct "Desciption" and "Sum Quantity of that Description" in the "Summary" sheet.

[URL]

View 1 Replies View Related

Save Each Worksheet As PDF File And Name Each File Based On Cell Value In Each Sheet

Jul 10, 2014

I have a Workbook that already has a macro in it that will generate multiple sheets based on certain criteria.

For each of these newly generated sheets (numbered 1-6 in the attached example), I need to be able save each of them to a PDF file based on a unique name contained in a certain cell (in this case, each named is referenced in cell Q1 of each sheet). As such, I should end up with 6 pdfs based on the attached sample files.

The PDFs would ideally need to be landscaped and should be just 1 page per sheet.

In my attached sample workbook, you'll notice that I have a "PracticePrint" macro that doesn't quite get the job done. One other criteria involves not printing any sheet with the characters "1010" in it (my PracticePrint macro is setup to do that, but it fails to do much else).

View 1 Replies View Related

Creating A Gantt Based On Values In Cells

Jul 9, 2008

Based on a Beginning Date Value and an Ending Date Value - I would like to color a range of Cells - the month (dates) are in the header row.

For example: Beginning Date = 01/01/09
Ending Date = 06/01/09

I want the range of cells in the same row colored orange under Jan '09 to June '09.

View 8 Replies View Related

Creating List Based On Data In Two Cells?

Dec 16, 2009

Sheet11

EFGHIJK8480NVF-25747NVF25747

8581ATT-67546ATT67546

8682RTC-35615RTC35615RealRTC-35615
8783CSX-45715CSX45715RealCSX-45715
8884CSX-24915CSX24915RealCSX-24915
8985HTC-56947HTC56947

9086MCAS-85415MCAS85415RealMCAS-85415
9187BNSF-77716BNSF77716

9288MCAS-97316MCAS97316

9389CLRV-24760CLRV24760

9490CSX-24101CSX24101

View 9 Replies View Related

Creating A Yearly Database File Using Information In Daily File

Feb 7, 2008

I would like to automatically update a 'yearly' database file with info from a file that is changed on a daily basis.

The daily file that i use has info like date, truck number, delivery stops, weight.

the database file has the similar headings.

at the end of each day this daily file is saved. I would like to have the info that is entered into the daily file automatically plugged into the yearly database file into the next available group of cells with respect to the salesperson.

This is kind of a generalization but i'm hoping to just get pointed in the right direction. If something like this involves vba then it will be beyond my ability and i'll have to do it manually, which is fine

View 9 Replies View Related

Autohide Cells In Sheet 2 And 3 Based On Sheet 1 Cells That Are Hidden

Feb 12, 2014

Need to autohide cells in sheet 2 and 3 based on sheet 1 cells that are hidden. (Example if i hide 150 switchgear on SOV tab it will hide 150 switchgear in Customer and Foreman sheets as well).

View 1 Replies View Related

Highlight Cells In Sheet 1 Based On Cells Existing In Sheet 2

Jul 11, 2013

I have a sheet (sheet1) of around 900 rows with data in columns A-K. Column B contains a unique value.

Sheet2 contains data which needs to be highlighted in sheet1 and each row in identified by a unique value in Column B.

sheet1.PNG
sheet2.png

In sheet 1, I only want to highlight the cell which exists in sheet 2 for the matching reference number in column B. For example, in sheet2, the value 'PM328491CN' exists and the value 'CN' is present in cell c2. I want the cell that contains this value in sheet 1 to be highlighted (cell C6).

So, find the matching reference, the highlight the cell in the row which is present in both sheets.

View 1 Replies View Related

Save File Name Based On Sheet Name

Feb 10, 2010

I am currently using a simple macro to save my spreadsheet.

View 14 Replies View Related

Creating New Sheet From Template Sheet & Filling In Summary Sheet - Userform

Oct 22, 2007

I have some experience with excel, but until now have not ventured into VBA and macros.

I have a workbook which will have the following sheets:

1.Absence Summary sheet - Summarises data from each employee's individual sheet.

2. Template Sheet - A sheet formatted as an absence record sheet, but without data.

3. Individual employee Absence record sheets - Based on the Template sheet.

I have read with interest the various posts and help files on User Forms & Macros, but have got a bit stuck.

My Aim: ....

View 11 Replies View Related

Select / Open File Based On Today Date In Sheet Name

Sep 15, 2014

I managed to create some code that will connect to a workbook and take the data from there.

It is kind of SQL mixed with VBA. I just got this by finding it in google (I don't have the link handy now).

What the file does, is it will take 2 columns from a workbook called "Test.xls" and then take out 2 columns "Name" and "ID".

The only thing is, this is only a test and not the actual files I need to open. the files are always saved on the same folder, but the name is the day of the export of it. So when I export a file today, it will get 2014.09.10.xls. The sheet (only 1) will also get that name.

How could I change the below code that it will take that file based on today's date and read from the sheet with today's data?

VB:
Sub sbADO()
Dim sSQLQry As String
Dim ReturnArray
Dim Conn As New ADODB.Connection
Dim mrs As New ADODB.Recordset
Dim DBPath As String, sconnect As String
'DBPath = ThisWorkbook.FullName

[Code] ....

View 9 Replies View Related

Import Text Files Into Sheet Based Last Month (name File)

Aug 15, 2014

All my files is in C:UsersmarrecoDownloads All files has name formatt (yyyymmdd) -> 20140814 I need import only last month files

Every day a system plays text files within the (C: Users drake Downloads ) folder.

E.g. I have to import only the files that have the name (yyyymmaa) based on last month.

[Code] ......

View 14 Replies View Related

Open File Based Cells Criteria?

Jun 29, 2014

How to open files based criteria in cells value?

[Code] .....

View 5 Replies View Related

Attendance File - Copy Multiple Cells From Many Sheets To One Main Sheet

Feb 6, 2013

I have an attendance file w/least 30 sheets. 29 of the sheets are for each separate group. The other sheet is the main one where I need to collect information like "total participants in attendance" and "total members in group" Then I divide those two and get the percentage of attendance.

The sheets containing the individual groups info are set up like this... (1=they were in attendance)

GROUP 1
Name / January / February / March/
Jess________1________0________1
Ryan_______1________1________0
Joe ________1________0________0
----------------------------------
total P ____3________1_________1
members___3________3_________3
% _______100_______33________33

The main sheet looks like this

Group / Jan. Participation / Jan. Member total/
Grp 1 ________3_____________3
Grp 2 ________8_____________10
Grp 3 ________7_____________10
---------------------------------------------
_____________18____________23
% total-__________________78.2%

I know I can manually go through and link the sums of participation and total group size into the main sheet, but I have a lot of workgroups and need to do this every month, is there an easier way? I am willing to change the set up of the sheets.

View 2 Replies View Related

Creating A Log File

Mar 2, 2010

I've got numerous vba-coded spreadsheets in use with lots of different users, and have found that some users try to hide errors of their own making by blaming the spreadsheets (I know - what is the world coming to!)

I've decided to add a script which creates a log file each time one of my spreadsheets is used - opening a log which relates to the user's spreadsheet and recording username, date/time, path & file, and the vba being used.

I'll probably add an "on error" script to save copies of all open workbooks too.

The issue I have at the moment is how to record the name of the macro being run?

Here's my code so far: ....

View 9 Replies View Related

Macro And Creating CSV File

May 5, 2009

I have a text document to which i need to do some changes and then turn it into CSV. Here are some lines of what the document looks like and below i will show you what i need it to look like. So i open the document with Excel and next I'm not sure how to do what i will show you below. Original:

HTML 111text
112text
113text

Here is how i need it:

HTML 1,1,1,"text"
1,1,2,"text"
1,1,3,"text"

View 5 Replies View Related

Creating A Template File Using VBA

Nov 12, 2007

I need a little help creating the macro for a template file which is going to be used for data input and further analysis. I have a set of arrays, which can be altered. The arrays may look like so:

View 9 Replies View Related

Creating A Link To The .pdf File

Jan 29, 2009

I have some code that looks at the part # in column D and then goes out to the D drive to drawings (.pdf files) and creates a hyperlink.

The problem is that it is only creating a link to the .pdf file and not to folders. I need a hyperlink to the folder so when it is clicked the open folder pops up and shows the multiple files associated with that part.

Link should be the same regardless of file or folder, no? As long as the name matches link should be made, correct?

E.g.
123-100.pdf (column D part #) links to 123-100.pdf file on CD
456-200 (folder name in column D) no link created to folder named 456-200 on CD.

Sub Hyper()
MyPath = "D:"
StartRow = 2
EndRow = 20

x = 0

For i = StartRow To EndRow

Cells(i, 4).Select

MyFileName = ""
MyFileName = Dir(MyPath & Cells(i, 4).Text, vbNormal)

If MyFileName "" Then
x = x + 1
Cells(i, 4).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="D:" & MyFileName
End If
Next i
End Sub

View 9 Replies View Related

Creating A Text File With Vba

Oct 6, 2006

each row in sheet1 contains variables that, when applied to cells in sheet2, calculate a final figure. I have written code that selects each row, distributes its variables in sheet2, and shows the result back in sheet1, then selects the next row, and so on until all rows have been calculated.

The calculation is complex, and I would like to create a text file that stores the calculation for each row in the same text file. The calculation is a 9 columns by 33 rows, and I would like to preserve this shape in the text file, though its OK not to have columns not lining up.

There is a similar problem on an old thread but this requires only one iteration of "open file, write values, close file". I need "open file, write values, write more value, close file".

View 4 Replies View Related

Creating A New File With Code Of Its Own

Mar 2, 2007

I need to distribute it to several areas of my company. Each area only needs part of the report. Therefore I have written some code which splits the existing report by area and creates a brand new report with that smaller chunk of data in it.

However I now realize that the new sub-report will require some code of it's own in order to function. My problem is that only the sub-report will be distributed to the end user. The core report will not. Therefore any code written for the new sub-report must be included within the sub-report.

View 4 Replies View Related

Creating A .text File

Apr 2, 2007

I have many users of the same spreadsheet on different PCs writing .txt files to a common directory on a central server. I want to be able to create a uniquely named .txt file, using a set naming convention (datetimeotherthingsetc.txt) each time they execute my export code routine. Is there a way I can create a txt file from vba code? I have figured out how to write into an existing .txt file but would like to know if I can create a .txt file from scratch from vba code? ps to avoid any confusion I dont want to save (ie save as) the open spreadsheet to a .txt file

View 4 Replies View Related

Creating Folder Beside The Excel File?

Apr 23, 2014

Just striving to have this kind of "picture arrangement's macro" to work, macro that whenever you choose a certain cell and operate it on hotkey it'll:

1. Create a new folder named "PicturesAuto" beside the excel file (wherever the excel file located).

2. Inside folder "picturesAuto it'll create a new subfolder named by the same name of the sheet related to that cell you operated the macro upon. (let's say this cell placed on sheet named: "happysheet"- that'll be the name of the subfolder created.)

3. Inside the subfolder "happysheet" it'll create a new subfolder named by the text of the cell you activated the macro upon (let's say you initially operated the macro on B5 cell -which has the text "montana" so it'll create "montana" subfolder also inside subfolder "happysheet")

4. Lastly instead of having only the text "montana" in "B5 cell" like we had initially before activating the macro, the macro'll also add to that text "montana" the link to "montana" folder (path of excel file->picturesAuto->happysheet->montana)

The way I'm planning to use this is to add a lot of HR pictures inside those folders created by the macro that related to that specific sheet, and that specific cell I've activated the macro upon. Plus just having those pictures so organized is just outstanding in every scale, and the excel file will keep running smoothly without any resource consuming overload.

View 7 Replies View Related

Creating Multiple File Picker

Mar 6, 2014

I am trying to create a multiple file picker. The code is below.

I want to open the first file of lets say 5 selected files, do some autofilter task, copy data from that file, paste it in another workbook and close it. Open second file, do some autofilter task, copy data from that file, paste it in below the first file pasted data in another workbook and close it... and File 3... and so on.

It works for one file, the code for copying pasting is not yet added. I think I can manage that. But how I return to the file picker function after it opens the first file.

View 1 Replies View Related

Creating File Path Automatically

May 27, 2009

I am looking to have these workbooks save automatically to a folder on the C: drive.
If the folder I specify is not available on the C: drive, how do I write teh save comand to create it automatically with a prompt

View 8 Replies View Related

Creating String Using Variable File Name?

Dec 18, 2012

I'm trying to check to see if a file exists using VBA but the routines I see use a string that has the path and then the file name. I have a fixed path C:VBtesting and the a variable file name. I'm using a file name that consists of a username & date such as cwilliams201212. I'm having problems getting the variable file name into the string.

View 1 Replies View Related

Merge Cells Based On Input From Another Sheet?

Jul 4, 2013

i am trying to merge cells based on the input from another sheet. these input will change from month to month and i need the sheet to cancel the merge and merge again based on the new input.

Example.xlsx the file showing what i need it to do.

View 8 Replies View Related

Copy Rows Based On Cells To Another Sheet.

Dec 9, 2009

Attached is a sample of what i'm trying to do.
I want to use the data in the Setup Sheet to parse data in the Master sheet.

so for each row in the Master sheet, if the Property Column cell matches a Property cell in the Setup sheet, copy that row to a sheet named after the Person Cell (identified in the setup sheet).

Sorry if that's not very clear. I am not proficient at using advanced excel functions. I'm hoping this is an easy one..

View 6 Replies View Related

Copy Cells To Different Sheet Based On Range

Mar 22, 2012

I need to make a VBA Macro (Assigned to a button) that will copy the information under the "Cut Length Worksheet" and paste it into the appropriate columns in our "Bill Of Materials Template." Any way to copy the cells, across different rows, into the proper cells.

I have several different Macros and Workbooks made up now, but I am lost here.

I also need the Cut Lengths to add certain info to the cell when it is copied:

8 | 7-15/16 ---> 8'- | 7-15/16"

Here is a Link to the Excel page.

View 3 Replies View Related

Copy Cells To 2nd Sheet Based On Conditions

Apr 17, 2012

I have 2 worksheets (X and Y) and am trying to write a macro/vba to copy certain cell values from a row if that row has a marked cell. For example, on sheet X, marked cell is column P and when P = "Y", then values from cells B, D, I, J, L need to be copied to sheet Y.

Sheet Y has multiple rows and the values from X need to be copied into appropriate rows. B from X goes into A from Y, D into B, I and J into C, etc.

Im not sure how to go about this other than have every cell copied and then filtering sheet Y. But Id like to have a macro only copy marked rows and appropriate cell values (some contain formulas) as the data is constantly changing and sheetY has to be printed up.

View 3 Replies View Related

Populate Cells Based On Data In Another Sheet

Feb 24, 2010

I run this macro that populates 7 cells based on data in another sheet. It seems that every sheet that have formulas that point to this sheet are being stuck in in the screen updating somehow?

Basically when I press F9 to calculate or change any cell that makes the sheet calculate it has like a screen burn in of all the sheets that are being calculated. I have been able to use this as a workaround:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Application.ScreenUpdating = True
End Sub

But I shouldn't have to do this and it slows it down as it runs through this specific code about 11 times for each sheet that is re-calculating. Something is getting stuck in memory or something that seems to be causing this issue. This is the code I am using and I am not selecting any cells or sheets, but it appears that when I walk through the code that an image of the sheet comes up on the screen? The code in red seems to be what is causing the issues, but I do not know why? I can pass the 2 workbooks along to someone so they can see the behavior if they would like? Just let me know.

Sub populateEmployeeData()
Dim srcWorkbook As Workbook
Dim foundEmployee As Range
Dim srcWorkbookName As String
srcWorkbookName = "XIP_Employee_Data_" & Left(ActiveSheet.Range("B9").Value, 31) & "_" & Format(ActiveSheet.Range("B10").Value, "MMMDDYYYY") & ".xlsx"
If IsWorkBookOpen(srcWorkbookName) Then..........................

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved