VB/Macro To Replicate Data
Jul 24, 2007
if i create a record in 'XYZ' worksheet, it should create the same record in TARGET worksheet.
Likewise, if i create a record in 'ABC' worksheet in the same workbook, it should create the same record in the SUBSEQUENT ROW of the TARGET worksheet.
For this to happen, it must be done programmitically either using a MACRO or VB Script.
View 9 Replies
ADVERTISEMENT
Feb 18, 2014
I have list of data with corresponding number of chances ( see attached column E) I need to replicate the data under column A,B,C & D to a new rows as per the number under column E and so goes till the end of the list using a formula.
Basically in the attached example i should have a 43 new data rows
View 4 Replies
View Related
Feb 15, 2009
I have a workbook with ten sheets. The front sheet is a summary with nine divisional data sheets (DDS) following. In every sheet cell G12 has the date. At the moment the DDS reference the summary sheet and pick up the same date from it. Is it possible to set it up so that if I change the date in cell G12 on any of the sheets I can get them to all read the same?
View 11 Replies
View Related
May 30, 2007
I'm exploring a different approach to my current project.
Sheet1, CellA1 contains the year ie. 2007
Sheet1, CellA2 contains the storage directory ie. E:archiveyear
Sheet1, CellA3:A10 contains the names of the employees.
Here is what I would like to make happen.
Running this in a macro, the result would be a copy of Workbook2 renamed for each employee's name in cells A3 through A10 and all saved in a newly created directory of
E:archiveyear2007employee name1.xls
E:archiveyear2007employee name2.xls and so on..
View 9 Replies
View Related
Aug 15, 2012
I have a userform that has nested multipages (5 in the outer page, 4 in the inner page).
On each of these multipages, I want to have the same controls (sliders) laid out in the same order - but with unique names, named after their tab location, for each control so I can use their value property later in the code.
I've designed the layout and named all the controls on my first sheet (e.g. Slider1Outer1Inner1). I now need a way of automating the replication of these across the other 19 sheets (including the nested inner multipage!); so that equivalent slider for example would be called Slider1Outer1Inner2, Slider1Outer1Inner3 etc.
I'm not sure about coding VBA to act on items within VBA...
VB:
" For each multipage in outer
For Each multipage In inner
For Each Object In current multipage
Copy inner.object -> Next multipage
Inner.object.name = CurrentOuter & CurrentInner & CurrentSlider "
View 2 Replies
View Related
Oct 18, 2007
How can I continue to replicate this formula automatically?
Interest RateAmountM1M3Formula Required
1%10000010001000=B2*C2
2%10000020001000=B2*C3
3%10000030001000=B2*C4
4%10000040002000=B3*C5
5%10000050002000=B3*C6
6%10000060002000=B3*C7
7%10000070003000=B4*C8
8%10000080003000=B4*C9
9%10000090003000=B4*C10
10%100000100004000=B5*C11
11%100000110004000=B5*C12
View 9 Replies
View Related
Dec 16, 2009
I understand the end(x1Down), but i think I am missing something. I just want to go to the next cell left, right or Up, Down from whatever cell is currently selected. How do I replicate a 1 cell move as an arrow key would do?
View 9 Replies
View Related
Dec 15, 2007
I want to create a list from a "seed" word that consists of a word followed by a number (ex: seedword100).
What I want to do is to be able to create a list in Excel using that seed word and then have excel produce a bunch of replications of that seed word by incrementing the number part of the seed word by 1 for every replication.
So, for example, if cell A1 = "seedword100", I want Excel to replicate it up to "seedword199" like this...
B1 = seedword101
C1 = seedword102
D1 = seedword103
E1 = seedword104
F1 = seedword105
G1 = seedword106
H1 = seedword107 ...
and so on until the last cell = seedword199 (or whatever number I want it so stop at).
View 7 Replies
View Related
Jun 14, 2013
So I have a need to enter multi-line notes. Using a merged cell not working for me so thinking best to use a Textbox.
This works fine for entering the notes but I need to replicate the content on another Tab in the same Excel workbook.
So lets say I have named my Texboxes 'Textbox1' on one tab, and 'Textbox2' on another tab...... how do I replicate the contents?
I've tried putting =Textbox1 into 'Textbox2' like you would for a normal Cell but that does not work.
View 5 Replies
View Related
Jun 16, 2009
I created a UserForm to populate client billing info and job location info (so it's a two-parter). A clicked button will then populate a spreadsheet with all of the information. That part works fine.
When the client billing info is the same as their job info, I'd like to offer a checkbox that will populate the job info with the billing info rather than having to type everything twice (like you see on online billing and shipping orders).
View 5 Replies
View Related
Apr 21, 2007
I am trying to rebuilt a chartsheet without using copy/paste. I have chartsheets with 2 or more charts on it. I add a new chartsheet, then add a new chartobject and then I want to copy the same series ( name, xyvalues, values). Unfortunately it doesn't work.
Sub ReplicateCharts()
Dim Cht As Chart
Dim NewCht As Chart
Dim ChtObj, NewChtobj As ChartObject
Dim SrSerie As Series
Dim ns As Series
Dim x As Variant
If ActiveWorkbook.Charts.Count > 0 Then
For Each Cht In .Charts
Set NewCht = .Charts.Add()
NewCht.PageSetup.Orientation = Cht.PageSetup.Orientation
For Each ChtObj In Cht.ChartObjects...........................
View 8 Replies
View Related
Feb 11, 2009
If I need to replicate a formula in some cells, I usually drag it down or sideways. Is there any easier way to do this? I have large numbers of cells into which to drag the formula. Can I specify which cell range the formula is applicable to (i.e. A1:A10,000 or something) instead of dragging? If so how?
View 5 Replies
View Related
Feb 28, 2013
Actually i can do it just by using LOOKUP formula but the mark scheme says LOOKUP and IF.
If i use Just LOOKUP i should do the same thing for other cells but i want to generate a formula and replicate it through all the cells.
Here is the question;
Enter formulae in cells C2:C10 that refer to Book Orders.CSV and display whether the Text Book is Required by the student whose Student id is entered in cell A2.
I also uploaded the source file. Q3.xlsx
View 2 Replies
View Related
Jul 16, 2014
Is there anyway in VBA to show the key sequence Alt+Shift+F10 then c?
Trying to find an easier way to convert text to number rather than having to use the Error Box method all the time as several large worksheets.
View 5 Replies
View Related
May 3, 2007
I have two formulas which I'm using: =180*(120.5-1)/119.5 and =90*(60.5-1)/59.5
In the first example, I want to replicate the formula across row 1, but with the value '1' incrementing by 1 each time, upto 240.
In the second example I want the '1' value to also increase by 1 for each cell down column B, up to 120. when I try dragging the formula down or across, I am only able to replicate the formula exactly as in the initial cell (ie. the '1' doesn't change). I've tried using the $ symbol, but this doesn't work. I don't fancy doing this manually for a total of 360 cells!
View 5 Replies
View Related
Feb 29, 2008
I have a single sheet broken into multiple sections of 10 rows (see attached). The first 5 rows of the section are formatted and I need to Insert 5 rows underneath and format them the same. I can't work out how to do this for the different sections (ie: add 5 rows to section 1, then section 2 then 3). These functions will be on separate buttons to use multiple times. I would have used multiple sheets but the project calls for a single sheet representation.
View 4 Replies
View Related
Oct 13, 2013
I've got this relatively simple file I use to calculate some values for a game mod. Its currently using ad-hoc excel functions, but its maths related to aerodynamics and they get unreadable quickly. I'd like to move to VBA functions for ease of maintenance, and programming the maths part of the code has been no issue so far.
However, I don't understand how to replicate the functionality of the default maths functions regarding range inputs.
Simple example, one of the intermediate values is the Aspect Ratio of the wing:
Code:
=ROUND(2 * Semi_Span / Mean_Aerodynamic_Chord, 3)
This works fine with both numeric inputs, cell references, or, as shown here, defined range names.
However, my VBA version:
Code:
Function AspectRatio(b_2 As Variant, mac As Variant, Optional round As Integer = 3) As Variant
AspectRatio = Application.round(2 * b_2 / mac, round)
End Function
Only works with single-cell references or numeric inputs.
When called as:
Code:
=AspectRatio(Semi_Span, Mean_Aerodynamic_Chord)
It fails.
From my limited understanding - I've only started looking into VBA about 2 hours ago - I need to do a IsNumeric test on the inputs in question, and then use the row from Application.Caller.Address to select the right cell if the input is a range? Am I on the right track?
How to craft a Sub I can call in the 15+ math functions I made.
View 3 Replies
View Related
May 6, 2014
Using Excel 2010.
The background to this question is that I'm trying to replicate conditional formatting using a user VBA function, because I require a thick border around the cells (and the conditional formatting within Excel only has thin borders)
In the final function, there will be 9 combinations of formatting {Red, Amber, Green} interior with {Red, Amber, Green} thick borders.
The formatting is determined by a number in another cell (the "target" cell), which returns a value 0,...,8
I've only got as far as filling in the interior for the first combination, but the function returns an error "Application-defined or object-defined error".
VB:
Function VBA000_003_SetRAG(strTargetRange As String) 'strTargetRange is the reference for the target cell that contains the value 0,...,8
On Error Goto handler [code]....
There is not a problem with the target range, if I remove the two lines relating to rngCaller then the function works OKExecuting the rngCaller.Interior.Color = RGB(255, 0, 0) command through the Immediates window works OKI've tried calling a subroutine & passing the range across
Same errorChanging the range in the subroutine to an absolute range (eg. Sheet1.range("A1")) also causes the
same errorExecuting the subroutine on its own (with the absolute range) works OK
So my guess is that it's a bug/limitation with Excel VBA when trying to execute commands from inside a user function
View 3 Replies
View Related
Feb 17, 2010
how to setup the original RAG shapes in order to replicate the feature in other s'sheets.
If you drag away from one of the RAG shapes, it takes a copy of the shape but leaves the original shape intact. It seems to be locked in place, but there are no macros or VBA code doing it.
View 2 Replies
View Related
Apr 30, 2014
I am attempting to create a macro to generate emails based on data in a sheet. The goal is to run the Macro, and have it generate emails to send to contractors letting them know what they are going to be paid. For instance:
Name in Column J
Email in Column L
Memo in Column N
Balance in Column T
Due Date in Column P
Week Ending Date in Column H
Now what I would like to happen, is to tie a macro into a button that will create the email as follows:
To Field: Email address from Column L
Subject: "Company Payment Remittance Payment Date *Date from Column P*"
Body: Hello *Name from Column J*,
For *WE Date in Column H* you will be paid *Balance from Column T* for the time worked of *Memo in Column N*
Now the tricky part is that I want the email to contain all line items for each email address. So instead of sending one email per line, have the macro automatically put all of the information that needs to be sent to one email address into the message. I don't know if that is possible, but it sure would make my life easier if it was.
I have attached a sample workbook of the data that will be used
Example Workbook for Email Macro.xlsx
View 1 Replies
View Related
Jul 15, 2014
I have a table in the format below with about 3500 rows
Column A
Column B
0001
All vehicles, Retirements
0002
All vehicles, Retirements, Addition
0003
All vehicles, Retirements, Addition, Deletion from Y
I would like to change it to the following format:
Column A
Column B
0001
All vehicles
0001
Retirements
0002
All vehicles
0002
Retirements
0002
Addition
0003
All vehicles
0003
Retirements
0003
Addition
0003
Deletion from Y
View 3 Replies
View Related
Apr 15, 2014
I'd like to have a sheet with multiple columns of data (say A thru K for instance.). Id like to reserve column A for ONLY imputing an X. The rest of the columns b-K would have data in the cells. I'd like to have a macro that when it saw an X in column A, would copy all of the data in cells B-K in that row, paste it into the next empty row of a second sheet (for history tracking), then go back to the original sheet and continue looking for additional "X"'s and repeat. Once all of the X's were copied, it would "clear" (Not delete because some of the cells would have formulas in them that would need to remain for future use.) the cells based on the "X" then finally move all of the remaining data up to the empty rows to fill in the empty rows. This last piece would be more for esthetics to have a clean looking sheet.
View 1 Replies
View Related
Mar 8, 2014
I have data in sheet 1 like below
Custid loc city
123 us newyork
124 uk wales
876 in mumbai
Sheet 2
custid newcustomerid
123 756
124 394
Outputsheet:
Custid loc city
756 us newyork
394 uk wales
876 in mumbai
So it will check sheet1 custid with sheet2 custid. If both matches it will replace custid with newcustid.if cust id not exists it will load sheet1 recprds as usual.
View 1 Replies
View Related
Mar 28, 2014
I have two worksheets. Sheet 1 has 2 columns, Column A the restaurant's name and Column B contains the review score. So sheet 1 is kinda like this:
Restaurant |Score
Ruby Tuesdays 80
TGIF 78
Outback 92
Sheet 2, Row 1 column B-E contain restraurant names (only on the top row, like field names).. i.e. I manually put the date in because typically the projected date is different from the actual review date.
-A----------- B ----------------C ------D-------- E-----
Date |Ruby Tuesdays|Olive Garden|TGIF|Ruths Chris|
I need the data from Sheet 1 Column B moved to sheet 2 in the next open row (i currently have data in row 1..the field names and down to row 35). This will be continuous so each time i need it to add the score as a new row in the correct field (restaurant name), IF the restaurant isnt listed, I want a new field named with the restaurant name and then place the score in the correct row and column. So, in the example I'd need Outback added.
View 9 Replies
View Related
Dec 6, 2006
I have one source spreadsheet, where are columns NAME, DATE. I read these data by ADO to other spreadsheet, where I can change/delete data and then run macro for update data in source spreadsheet. The problem: In source spreadsheet is column "NAME" and column "DATE", with values e.g. "Joseph"; 1.1.1980. I read this data to other spreadsheet, then I delete in it value 1.1.1980. When I run macro Update, it messages error.
Sub UpdateItem
...
.Fields.Item(1).value = activecell 'activecell value = "Joseph"
If Not isempty(activecell.offset(0,1)) Then
.Fields.Item(2).value = activecell.offset(0,1).value
Else
.Fields.Item(2).value = "" 'I tried Empty and 0 too but when I read data again then, it displays 0.1.1900, nothing works
End If
...
End Sub
It seems that in source spreadsheet has data in column "Date" format Date and when I try to update data in format String ("") in source spreadsheet by Update macro, it messages error. When I used
.Fields.Item(2).Value = Empty
' or
.Fields.Item(2).Value = 0
after rereading data it displays 0.1.1900 What I want to get is that if the cell with date (in other spreadsheet) is empty, the cell in column Date in source spreadsheet after updating will be blank (contains no values).
View 2 Replies
View Related
May 12, 2013
I am working on a project and would like to see if there is a solution for it. i have a workbook that has data entry that is summarized at a master level but I need to automatically use a formula to update another sheet after clicking an udpate button. The data from the data entry sheet needs to be allocated to all the lines that has the same master item based on the formula. A test workbook is attached ...
View 1 Replies
View Related
Oct 18, 2013
I have been working on a macro that compares a existing list of data to an updated list of data and then either moves any data not on the new list over to a completed tab (followed by deleting the record on the existing sheet), and then adds any items not on the existing sheet, but which appear on the new list, to the existing list.
I have come across a stumbling block, i have managed to identify on the existing list the rows of data that have been removed from the new list and therefore need to be moved over to the completed tab, but when i select the data it selects the header row aswell (which will always remain the same row). Obviously this then pastes the header row aswell, and also i can't seem to get it to paste in the new sheet to the next available row (i.e this will be used daily and i don't won't to overwrite the infor already in the completed tab). the next issue i have is then when i go back to existing sheet to delete the data i just copied across, as the header was initially select this also gets deleted.
The code below, is the complete code, including filtering, copying some forumals etc. The area i am getting stuck on is highlighted in red:
Sub Update()
Dim bottomrow As Long
Dim My_Range As Range
bottomrow = Cells(Rows.Count, "C").End(xlUp).Row
Set My_Range = Range("A1:Y" & bottomrow)
[Code] .....
View 6 Replies
View Related
Jan 30, 2014
I am trying to create a "Master Sheet" where I enter in the column data and after I have entered my data for each row, I can select the button which toggles the macro to run. I have it built to build new sheets as new clients are obtained. My problem is after I have a sheet that has client's data I cannot get new data to add itself below the data that is already there. I want each client's sheet to keep adding rows as more data comes in. My current macro is :
[Code] .....
Attached File : Data Entry Macro.xlsx
View 3 Replies
View Related
Jul 8, 2014
I'm creating a macro that will involve some form of if-else/case-switch, as well as a loop (probably), but I'm not too sure how to go about it.
Basically there are records in columns. Lets say Column A has numbers in it, for example
Cell A1 has "Three"
A2 has "Five"
A3 has "Two" all without quotes
I basically want a macro that will loop through the whole column, so if A1 contains "Three" (not case sensitive), then set B1 to "3" without quotes. If A2 contains "Two", then the macro will set B2 to "2" without quotes.
Of course this is sample data but you get the jist. It needs to loop through one column, so as to fill in the other column. You can assume that column A will always be filled, so the macro is being created to automatically fill in column B based on what is in column A.
View 1 Replies
View Related
Jul 21, 2014
I need to take data from spreadsheet Control Master.xlsx then apply calculations from another one Calculations.xlsx and record results to the first spreadsheet.Data to be taken from Control Master.xls columns C, D, E. After calculations results (Calculations.xls columns Q, R, S) to be recorded back to Control Master.xls columns F, G, H.
View 4 Replies
View Related