Combine Data Macro Code
Oct 19, 2006
I'm trying to get the following code to work (as a practice run for a bigger set of spreadsheets) but it doesnt seem to work - no errors either. There are 3 workbooks all with 1 worksheet called "Data 1" with 3 columns of data (under 20 rows). These (theoretically) should copy into 1 called " Totals". The code I have used is: ....
View 9 Replies
ADVERTISEMENT
Sep 30, 2009
I have a workbook with two sheets that I need to combine some of the data from. Sheet1 is a template to be used for translation purposes on Sheet2. I would like to put Sales Rep Info in column C on Sheet2 (has only Sales Rep ID) using Sheet1 as a translation table (shows Sales Rep ID and Sales Rep Info). I can do this with a vlookup function but would like to know how to do it in a macro so I can use on other more complex workbooks. Here is a sample data set.
View 3 Replies
View Related
Sep 9, 2009
I am now trying to combine 2 sections of code but being a complete VBA novice I'm stuck, where should the second Sub go so that it works,
View 4 Replies
View Related
Mar 24, 2009
Need to combine the code below in one line?
View 2 Replies
View Related
Mar 27, 2009
I am trying to combine the 'Mail Range' from this code http://www.rondebruin.nl/mail/folder2/mail4.htm with the 'Mail to address in A1' from this code http://www.rondebruin.nl/mail/folder2/mail5.htm and can't make it work. Maybe this is the wrong tactic to take but I have very little knowledge about writing my own code. The ideal solution would make a copy of a a specific range of cells from a specific sheet, mail it to a recipiant (could change based on what is entered in the field) and delete the copy. I will try to attach an example next week.
View 4 Replies
View Related
Mar 26, 2014
I saw the below code in another thread that does almost what I need it to do. The only thing is that I need to only select certain worksheets, not all. Is there an adjustment I can make to this code or is there something I can do differently?
Each worksheet has a table on it as well, is there a code I could use to just combine certain tables?
Sub debit1()
'Combine all worksheets to the Summary sheet
'Created by Trevor G 30 June 2011
Dim ws As Worksheet
[Code]......
View 7 Replies
View Related
Aug 2, 2006
the listbox will show week 1 to week 52 and let me choose one of the week.
Private Sub OKButton_Click()
If ListBox1.Text = "Week 26" Then Call week26
If ListBox1.Text = "Week 27" Then Call week27
Unload Me
Sheet7.Activate
End Sub
Sub week26()
With Sheet7
.AutoFilterMode = False
. Range("A1:I1"). AutoFilter.............
Since there are 52 weeks in a year, i have to type the codes for 52 times for different weeks. i don't need to type all these codes 52 times, instead one time with a loop or something else.
View 5 Replies
View Related
Jun 2, 2013
Taking advantage of csv files and importing into websites. Basically I have a html code in a cell which needs to pick out content from different cells in the same row. Is that possible?
<a href="/signup?name=A2&email=B2">Go</a>
So the A2 and B2 would be contents of their respective cells. Tried out a few things but kept getting errors.
View 1 Replies
View Related
Aug 26, 2013
I am using the code below to combine the rang of cell values into 1 cell. with this code I need to select the range of cells manually and run the code then repeat it on the next row manually.
What I need is automatically find the range from selected cell till last cell in the row and run the cod for this range then do the same on next row until last row of the sheet.
Code:
Sub JoinAndMerge()
Dim outputText As String[code]....
View 1 Replies
View Related
Mar 17, 2009
I have a few hundred cells that I would like to combine. Each cell contains a six digit code number. I would like to combine the cells with a semicolon and a space between each code number.
I can do this with the CONCATENATE function but it will take too long.
View 9 Replies
View Related
Oct 19, 2006
I am trying to use a dynamic VBA code to import data into a xcel sheet from another sheet. I currently have it working but in the code I have the directory and the file name listed for the file to be imported. I would like to change this to a cell referance inside my sheet so that I can make changes to the name of the file or the directory location and the VBA code would use the cell reference as the source data.
View 9 Replies
View Related
Mar 30, 2008
I do not know VB coding but is in need of help on data filtering/matching. I have 2 very big excel workbooks with a few thousand lines and am trying to do some filtering/matching. Example below.
The two workbooks I have contains same data in column A and also column D from the first data set is the same as column B in the 2nd data set. I am trying to add column C and D from the 2nd data set to the 1st data set and need to make sure they match up to column D from 1st set and B from 2nd set. It is quite strenuous to do this manually,
A1 2 3 100A
A1 2 3 100B
A1 2 3 100C
A1 2 3 100D
A1 100A AA BA
A1 100B AB BB
A1 100C AC BC
A1 100D AD BD
View 3 Replies
View Related
Jun 29, 2008
i want to create a command button that would sort my data in descending order.
View 7 Replies
View Related
Oct 17, 2012
I have a worksheet that is automatically updated based on actions in other sheets. There are 10 columns of data (A-J) Headings are on row 6 and data starts on row 8. I have created 3 buttons to sort worksheet by client column (B), year-end column (E) and to bring it to original order (by numbers in column A). I have created the following codes that I have assigned to each button however it does not work.
Sub Macroclient()
Columns("A:J").Sort Key1:=Range("B8"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
[Code]....
View 1 Replies
View Related
May 21, 2014
I have an excel spread sheet with the page title "Main". I would like to add a macro by pushing a button and a window pops up. It will have 4 columns or 4 questions. The first question will ask what is the date? You enter date, next question asks, What is the fundamental? You enter the fundamental. Next question is what is your name? you enter name and next question is enter what you need fixed. Once you enter that and press finished, the data is then place in the spreadsheet. All rows shift down 1 spot. B2 answer is posted in B2, question 2 answer is placed in C2, question 3 answer is placed in D2 and question 4 is answered in E2.
Each time someone presses the NEW ENTRY button this window pops up asking these 4 questions. The answers are then posted in cells B2 through E2 after shifting the entire page down 1 row.
View 2 Replies
View Related
Mar 1, 2008
I have written the below code to enter some formulas, validation, and formatting. I keep running into a problem when trying to add the first validation.
The debug msg is...
Run-time error '-2147417848 (80010108)':
Automation error
The Object invoked has disconnected from its clients.
Debug highlighted portion is...
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=PRODUCT" ....................
View 9 Replies
View Related
Jul 5, 2012
I'm using Excel 2010 and XP. I have data in rows 1 -4 that can not be altered. There are headings in Row 5, B-L & Row 6, F-J.
Data starts in Row 7 and follows the headings. This repeats for several thousand rows. I need a way to move Row 6, F-J and put it on Row 5, M-Q
Row 6, F-J and put it on Row 5, M-Q
Row 8, F-J and put it on Row 7, M-Q
Row 10, F-J and put it on Row 9, M-Q
Row 12, F-J and put it on Row 11, M-Q
....
....
....
Then delete blank rows below Row 5
View 7 Replies
View Related
Feb 11, 2014
I need a macro code to add and rename sheets as per data given in column "A".
ie if column A has
SBC
DFG
UY
IKJ
4 new sheets to be created with name given above (Column A). PS:- the data given in column A will not be limited to 4 rows, it ll be > or < 4.
View 9 Replies
View Related
Jan 30, 2009
the following code filters data and copies to worksheets specified in code, can this code be shortened to make the macro run faster. Also in my second criteria how can I put "Contains "PT2" in the criteria as nothing happens when i run the macro, is *PT2?
With shtRec
.AutoFilterMode = False
.Range("A7").AutoFilter Field:=8, Criteria1:="LEHMAN", Operator:=xlAnd
With .AutoFilter.Range
On Error Resume Next
Set rng = .Resize(.Rows.Count - 1).Offset(1).SpecialCells(12)
On Error GoTo 0
End With
If rng Is Nothing Then
MsgBox "No data to copy"
Else
rng.Copy shtLehman.Range("A6")
End If
.AutoFilterMode = False
End With
View 9 Replies
View Related
Jun 5, 2008
Following syntax is incorrect, what is wrong? This should happen: Select op a specific worksheet (named DATA) in the workbook Report.xls and I empty the contents
Then I try with a 'With' statement to read the contents of a file named "sourcedata.xls' with helds a worksheet named "source". The values in this sheet should be tranfered to the sheet DATA in the workbook "Report.xls"
Sub FetchDataFromClosedWorkbook()
Dim FileName As String
Dim SheetName As String
Dim cellRange As String
Const ReportPath = "C:ExcelReports"
Windows("Report.xls").Activate
Sheets("DATA").Select
Cells.Select....................
View 3 Replies
View Related
Sep 23, 2011
I am building a rather good size userform. It is getting really lengthy code-wise because I want certain things to be enabled and disabled on the form as they click on certain options.
I know I can hard code the lines but so I am trying to come up with some coding elements where I will not have to add 20+ lines of code for everytime I want to add a new feature.
Here is one of the functions that I have, There is going to be several of these:
Private Sub chkMore2_Click()
If chkMore2 = True Then
cboProtocol2.BackStyle = fmBackStyleOpaque
cboApplication2.BackStyle = fmBackStyleOpaque
txtLowPort2.BackStyle = fmBackStyleOpaque
[Code] .......
So If I click chkMore2 ... all of the 2nd elements will be editable. If I click chkMore3 ... then all of the 3rd elements will be editable, etc. etc.
So I tried to play with this code example:
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Call Changeit(1, "yes")
Else
Call Changeit(1, "no")
[Code] ........
Excel 2007 does not like the .concatenate element.
View 1 Replies
View Related
Nov 12, 2008
I have a table which has employee names on the left handside. Next to them are contacts in a region.
View 7 Replies
View Related
Feb 18, 2008
I'm new to Macros and need your help. I've read online but can't find instructions on completing what I want.
I have a workbook with about 60 tabs that has various numbers of rows. I want a macro that will combine all the rows from each tab onto a new tab.
Is there an easy marco that i can do to acommplish this?
View 8 Replies
View Related
Feb 27, 2008
I've been Google-ing for the last 45 minutes and tried to combine them myself, but I'm afraid of breaking it.
I believe the second code was taken from the MrExcel site, I don't remember.
CODE 1:
// Track Changes; updates any/all changed cells with a comment identifying the author, date and change that was made //
Option Explicit
Public preValue As Variant
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Select Case Target.Column
Case Is = 2, 4, 6
Target.ClearComments
Target.AddComment.Text Text:="Previous Value was " & preValue & Chr(10) & "Revised "
CODE 2:
// Whenever a specific range of cells are updated, the adjacent cells update with a timestamp //
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("F3:F1000"), .Cells) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 1)
.Value = Now
End With
End If
View 9 Replies
View Related
Apr 28, 2014
I need a VBA macro code to get the output like in the excel file which I have attached with this thread. Which means, I need to group the data for every two hours. in the output I need all 4 cols namely A, B, C, D along with extra col namely, interval based on which I need these groupings to be done..
The code has to be really flexible so that it works for all dates and times in the files. Because like this I have to do for 2000 files.....
Original link: [URL] .....
plant area.xlsx
View 3 Replies
View Related
Jul 28, 2009
I received assistance from NBVC for combining data from two cells. Post http://www.excelforum.com/showthread.php?p=2135144. I need to convert the formula into macro code. I thought I would be able to convert it on my own, but running into some troubles with run time errors. Here is the Excel formula, which is working fine.
View 5 Replies
View Related
Sep 15, 2008
I have been given the following code to transfer data from multiple workbooks within folders and subfolders to retreive the same line of data from each of the workbooks and place them in a master workbook.
the folders are set up as follows,
there is a main folder, (a yearly folder)
within this are 12 monthly folders (named January to December)
within these are four weekly folders (named week 1 -week 4)
contained within these weekly folders are the workbooks that i wish to copy data from.
for example a1 - k1
the code i am using transfers the file names but comes up with #REF! instead of transfering the data
Here is the
View 9 Replies
View Related
Oct 14, 2008
i have the following spreadsheet with dummy data however, there is a before and after scenario i have posted is this possible with a macro ...
View 9 Replies
View Related
Nov 28, 2012
I have 5 macros to be run in sequence. I have copied them into the file attached with ----- line as separator between them.
How can I possibly combine them all into ONE MACRO?
View 5 Replies
View Related
Jun 8, 2014
Creating a macro that is a combination of other cell values. the cell order is listed below:
C57 = contains a unique number that will change from time to time eg. 1234
H57 = 1 (this will always be the value of 1)
N57 = contains text eg. AUDUSD
V57 = contains text eg. BS
AB57 = contains a number eg. 1.8954
AH57 = 0 (this will always be the value of 0)
AN57 = contains a number eg. 0.01
AS57 = contains a number eg. 1.7954
AZ57 = contains a number eg. 1.9954
BH57 = conatins either 1 or 0 eg. 1
the cell needs to contain the above examples like this :
BT57 =OpenPosition(1234,1,"AUDUSD","BS",1.8954/0,0,0.01,1.7954,1.9954,1)
This will be needed for a total of 14 rows (57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83)
The cell with the results cannot have any cell references contained in the end results and must be formatted as above so that the add in program can read and pass on the information.
View 3 Replies
View Related