Increment Using Concatenate
Sep 2, 2009
I want to write formula in cells(many cells!) using concatenate. The desired output:
In Sheet2!D1 - i will write concatenate of Sheet1!C6 and Sheet1F6
in Sheet2!E1 - i will write concatenate of Sheet1!C7 and Sheet1F7
in Sheet2!F1 - i will write concatenate of Sheet1!C8 and Sheet1F
Copy and paste formula would not do so i created a macro stated below. The problem is a can not change the ActiveCell.Formula correction.
View 2 Replies
ADVERTISEMENT
Oct 6, 2007
I have a list of P/N's that are used in more then one location. and it's sorted by P/N's.
ColA__ColB__ColC
______Loc___PN
______1_____A
______2_____A
______3_____B
______4_____C
______5_____C
I Want to be able to put in Col A the concatenate results of all equal P/N's from any given list. Or at least select the few cells that i know are duplicates and from that copy the Location to a single Column.
ColA ColB__ColC
______Loc__PN
1,2____1___A
_______2___A
_______3___B
4,5____4___C
_______5___C
View 5 Replies
View Related
Aug 11, 2013
Sampling table :
one
two
three
four
one
two
three
one
two
one
Desired results obtained via IF =IF(B2>0,A2&" , ",A2)&IF(C2>0,B2&" , ",B2)&IF(D2>0,C2&" , ",C2)&IF(D2>0,D2,"")
one , two , three , four
one , two , three
one , two
one
Is there any smarter, shorter formula via Concatenate and Substitute or other formulas ?
My closest match, but not good enaugh is =SUBSTITUTE(CONCATENATE(A2&", "&B2&", "&C2&", "&D2), ", , ", " ")
[ returna 2 commad ]
one, two, three, four
one, two, three,
one, two
one ,
View 9 Replies
View Related
Oct 20, 2009
I want to take the date value of a cell, add one day to it and paste it to another sheet's cell. For example if Sheets("x").range("i4").value is 12/12/1999. I want to add a day to it (13/12/1999) and then paste it to Sheets("y").range("d3").value
View 4 Replies
View Related
May 15, 2006
I have a sheet with the column for time the format should be h:mm:ss, the time begin with 0:00:00 and 10 sec periods 0:00:10 ...until 50sec again in the next count wud be 0:01:00 again 10sec periods.. How to write the Macro, that automatically increse the values of minute (mm)if the ss attains 60 and increment the hour(h) value if mm get 60.
View 2 Replies
View Related
Mar 14, 2013
I have a table... One of my cells is called Capacitors and the number of the cell is 202600. This is the default value. How can i increment this value?
For example:
I have capacitors in one cell with this value => 202600.
But I want to put capacitors in another cell and i want the value to be 202600 + 1 => 202601
Another cell with capacitors with 202600 + 2 => 202602
And so on...
Capacitors.JPG
View 6 Replies
View Related
Aug 19, 2014
I currently have a spreadsheet that parses a HL7 message string using "|" as a delimiter. The String that comes before the first "|" becomes the sheet name (Segment). The code executes on each line of the string (Each segment is parsed). The problem is that sometimes there are multiple segments with the same name. So instead of a new sheet being created, all segments are lumped into the same sheet with that name. What I am trying to do is have the code create a new sheet for each segment and if there it is already present, add sheet name with an incremented number.
So given the sample message The MSH, SCH, PID, PV1 etc sheets are fixed. The DoHL7Parsing routine takes the line and parses it out in the existing sheet. The problem I'm having is lines that are the same such as AIP get lumped into one sheet. What I would like to happen is have AIP1,AIP2,AIP3,AIP4,AIP5 and AIP6. Each with the line parsed out. These are parsed by segment not fields. I want to be able to recognize the existing sheets and create new sheets if multiple segments with the same name are being parsed.
Sample Message:
MSH|^~&|SR|500|CL|500|20140804150856-0500||SIU^S14|5009310|P|2.3|||AL|NE|USA
SCH|10262|10262|""|S14^(SCHEDULED)^L|44950^APPENDECTOMY^C4||^^^201408081345-0500^^^^^^2||30|
MIN^MINUTES|^^^201408081345-0500^201408081415-0500|10000000034^ROISTAFF^CHIEF^O||||||||
PID|1|5000|50^^^USVHA&&0363^NI^FACILITY ID&500&L^^20140804~666^^^USSSA&&0363^SS^FACILITY
[Code] ........
Current Code:
Option Explicit
Const HL7_DELIMITER_FIELD = "|"
Const HL7_DELIMITER_SEGMENT = vbLf
Sub DoHL7Parsing(sMessage As String)
Dim vSegments As Variant, vCurSeg As Variant
[Code] .........
View 1 Replies
View Related
Apr 5, 2008
I have a value in cell P1 and is always -ve.
This value is calculated by some tedious calcualtion in some other part of the sheet.
By entering value in Cell P2, the value in cell P1 will progress towards +ve number.
What i want is a formula or Macro to increment the value in Cell P2 by 0.01
until value in Cell P1 becomes +ve...
Below is the example of my manual calculation.
When i have
P2=0 P1=-23.58
P2=0.01 P1=-14.78
P2=0.02 P1= -9.30
P2=0.03 P1= -2.92
P2=.04 P1= 1.05
Since i have achieved P1 to be positive, calculation should stop with value in P2=0.04
I have to do this for 31 column and hence manually doing it takes long time
View 13 Replies
View Related
Feb 24, 2009
For Next Loop increment. simple For-Next Loop:
View 2 Replies
View Related
Sep 15, 2008
I have a formula that I'd like to have increment by one, but I can't figure out how to do it.
Here's the formula:
=IF(INDIRECT("'Supervisor'!B"&ROW()-4)="Y",E12-D12,IF(INDIRECT("'Supervisor'!B"&ROW()-4)="N","0",IF(INDIRECT('"Supervisor'!B&ROW()-4)="","0")))
I'd like to have the -4 in the equation increment to -5 when I paste it to the next row without having to fix each one of them.
View 14 Replies
View Related
Sep 22, 2011
I have a input worksheet and in this user have to manually enter the sequence no. The sequence no. heading is not always in one cell that can be in any between any cell from D14 to D21.
I need some code which start the sequence no. with 1 and everytime I click add button. It find the sequence no. in range between D14: D21 and add 1 in the relavant adjacent cell (which can be in from E14 to E21).
See Table below
Start withColumn DColumn ERow No. can be any from 14 to 21Sequence No.1Clicked AddDesiredColumn DColumn ERow No. can be any from 14 to 21Sequence No.2DesiredColumn DColumn ERow No. can be any from 14 to 21Sequence No.previous val +1 and so on
View 2 Replies
View Related
Apr 20, 2013
The question that I have is as follows:
For i = 17 To FinalRow Step 14
'Select cells to examine based on For/Next loop Step...
Cells(i, 4).Activate
'Check for "value"...
If ActiveCell = Press Then
[Code]...
The "Cells(i, 4).Activate" statement steps my search criteria forward by the value of "i." The last thing that I want to do with this macro is to increment the value of A4, "Range ("A4").Select" and D6, "Range ("D6").Select" by the value of "i."
View 9 Replies
View Related
May 31, 2007
I want to test a condition and if false skip the rest of my for block and hit the next for:
For something = 1 to 100
if test = "false" ?NEXT FOR?
code
code
code
code
Next
I can set a lable at the Next and use a goto but that seems kinda kludgy.
View 10 Replies
View Related
Oct 31, 2008
How do I increment a cell by 1 when data in another cell is changed. In other words...I am logging phone calls made. When I enter the date I made a call I want a cell labeled "times called" to increase by one.
View 9 Replies
View Related
Jun 18, 2009
I would like to have a drop down list for cells in a row - say B1:I1.
Firstly, having the list (with only 2 selections) in these cells to place either an "A" or a "0" (zero) in a cell.
Next, if an "A" is added then a selection of a "B" or a "0".
If a "B" is added then a selection of a "C" or a "0". etc etc
If the "0" (zero) is selected and placed in the row then no more alpha but just the next number "2" available to select only then a "3" etc etc.
These would be added from left to right ie: A to H or 1 to 8.
I might be able to do this with a long formula but problem is there are 100's of rows. Maybe VBA would be more efficient?
View 9 Replies
View Related
Sep 22, 2006
i have created a form that links to other sheets in my book but can't get the info to stay when goto enter next lot of info.
i've been told about incrementing it but i can not work it out
View 6 Replies
View Related
Nov 16, 2006
I'm trying to increment a link to a file in my macro by 1 after each row. For example:
Row 1 "<a href="/ ai/grtcon/06-07-q2/gc1_e.html">
Row 2 "<a href="/ai/grtcon/06-07-q2/gc2_e.html">
Row 3 "<a href="/ai/grtcon/06-07-q2/gc3_e.html"> and so on...
I've indicated in the code in the first array where the increment should go (I'm not sure if it belongs in the array).
Option Base 1 ' sets first array element to 1, not 0
Sub makehtmlGrtCon1()
'Dimension all variables.
Dim DestFile As String
Dim FileNum As Integer
Dim ColumnCount As Long
Dim RowCount As Long
Dim LastRow As Long
Dim LastColumn As Long
Dim OpnTags As Variant
Dim ClsTags As Variant
' Array defines html tags to be used before each cell.
OpnTags = Array("<tr class=""size-smaller"">" & vbCrLf & " <td><a href=""/ai/grtcon/06-07-q2/gc" & INCREMENTHERE & "_e.html"">", _
" <td>", _ ...................
View 5 Replies
View Related
Jan 26, 2007
I have inherited a Spreadsheet/Data Base.
In my Worksheet I have 3 Headings: Contractor Supplied/Installed; Principal Supplied/Contractor Installed; Principal Supplied/Installed. Each heading has 10 rows below. In the Rows, spread over merged cells (inherited remember), are 3 columns:Item description; No. off & Remarks. When I print this I get an A4 sheet with 30 Rows and perhaps only 2 items in one of the Headings.
What I want to do, is to have initially 2 empty Rows per Heading shown. Then after entering data in Column A, Row 1, another Row automatically inserts below the empty Row.
I envisage there is always 1 empty Row. If that is possible I can minimize the use of paper and have 6 Headings on 1 sheet.
View 3 Replies
View Related
Jan 7, 2008
I am using Excel 2003 and I tried to copy stats from a web page to Excel using the Web Query function. I recorded the procedure using Record Macro function and the result I got is shown below. The URL is "http://somedomain.com/nba/pbb/gamestats.aspx?id=1139&year=2002". I need to change the 1139 value in the URL to its next increment like 1140, 1141, 1142 until it reaches 1202 (so 1139 to 1202, or "http://somedomain.com/nba/pbb/gamestats.aspx?id=1139&year=2002" to "http://somedomain.com/nba/pbb/gamestats.aspx?id=1202&year=2002". The year remains the same. Since I absolutely had no knowledge in excel vba, I manually changed the URL to extract the data. Is there a way I can automate this?
Sub Macro1()
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://somedomain.com/nba/pbb/gamestats.aspx?id=1139&year=2002", Destination _
:= Range("A1"))
.Name = "gamestats.aspx?id=1139&year=2002"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells...................
View 2 Replies
View Related
Aug 7, 2012
How to increment a formula with an If statement that transforms 2 values in time format and then as long as these two values keep beeing added in the cells the formula keeps active in the column.
I tried to apply the code for all the but this makes my file huge like 20MB!
You can check this on the file, go the "records" sheet, add the time in the "shift start" and "shift end" fields, then the difference value goes to "hours" in the sheet.
[URL] .....
View 4 Replies
View Related
Aug 15, 2012
I'm writing some VBA code for a Macro to run that will save my file in a directory using the file name from a cell. I want to be able to increment the save file name if the same file name already exisits
i.e.
If no file then save as FileName
If exists then FileNameVer2
If both exists then FileNameVer3
And so fourth (maximum iterations will be about 10)
I'm new at VBA but written some code to save
VB:
Sub SaveAs()
Dim FName As String
Dim FPath As String
FPath = "S:TestTest Directory"
FName = Sheets("Parameters").Range("B9").Text
ThisWorkbook.SaveAs FileName:=FPath & "" & FName
End Sub
At the moment I have concatenated four cells to produce the file name in B9 but if there was a way to use variables that would be awesome too!
The code runs when I press a macro button saving save, but at moment it says "file alerady exists , overwrite" when I put no, it goes to a debug.
View 1 Replies
View Related
Feb 26, 2014
I have a spreadsheet with 2100 rows. I am trying to fill one column with a numbering system that fills the same number in for 21 cells and then increases by one. For example:
TRIAL WHOSICK?
110TRUE
15FALSE
113FALSE
117FALSE
17FALSE
12FALSE
16FALSE
14TRUE
18FALSE
[code].....
However, I did the first column manually and wish to fill in my "trial" column for all 100 trials.
View 2 Replies
View Related
Jun 28, 2009
Here is what I try to do:
At
A1 = Power(C1,B1)
A2 = Power(C2, B1)
A3 = Power(C3, B1)
....
An = Power(Cn, B1)
How can I increment column C while keeping B constant at B1 by using right-bottom mouse pointer dragging on column A? Or is there another way?
View 2 Replies
View Related
May 20, 2014
I'm trying to copy data from sheet1 to sheet2, once it's in sheet2 increment it so I can calculate a total/count/avg of the data. I have some code that isn't compiling and I think it has to deal with the range of where it's being pasted. Also - I'm confused on how to make the data increment on the other worksheet. I have everything else figured out. I've attached copies of my worksheet for visual aid.
Step 1: Enter Code in highlighted area - Select Submit Data Button
Step 2: Fills incremented position on worksheet 2
See Code Below:
Looks like it's not reading the "Model" correctly.
I keep getting the Else message "Wrong Model Entered...."
I changed the ModR to: ModR = Worksheets(2).Range("A:A").Find(Worksheets(1).Range("B3").Value).Row
View 2 Replies
View Related
Oct 18, 2009
I have two columns C & D. In col C (C10) a time is entered (either 13.45 or 0:33.22 format). If column D (D10) is blank then the time in Col C stays the same (13.45 or 0:33.22). However if Col D has a M in the cell (D10) I want to add 0.24 to the time in Col C (C10) eg 13.69 or 0:33.46. I have tried various formula combinations but keep getting circular reference errors.
View 6 Replies
View Related
Sep 29, 2005
How do you get a value within a cell to increment, by say, 1, for each and
every worksheet within my workbook?
For example, the value in sheet1 in cell A1 is 100
in sheet2, I input...= 1 + 'sheet1'!A1 in cell A1 (value now is 101)
then, in sheet 3, I input...= 1 + 'sheet2'!A1 in cell A1 (value now is 102)
then, in sheet 4, I input...= 1 + 'sheet3'!A1 in cell A1 (value now is 103)
etc.,etc.,etc.
How can I input a formula...then copy and paste it into my sheets without
having to go to each and every worksheet to input the formula?
View 9 Replies
View Related
Oct 23, 2007
how can I enter a date & in another cell return the same date, but the next year.(ie 5/1/07, returns 5/1/08)?
View 2 Replies
View Related
Jan 9, 2012
What would be a good way to increment each of my ranges for example I need x to copy Range B11:to G20 and paste it to C10 for the second loop. Each Variable has different increments.
I'm horrible with Visual Basic.
Sub Macro5()
'
' Macro5 Macro
'
Dim i As Range, j As Range, k As Range
Dim x As Range, y As Range
Dim Num As Integer
[Code]....
View 1 Replies
View Related
Feb 27, 2012
iam clicking on A6 than that show in that cell 2
if i click on b3 it will show 3 and so on
View 2 Replies
View Related
Dec 17, 2012
I have items in a column like below:
50
50
50
50
What I would like to be able to do is highlight the four 50's and fill down, but I would like for it to increment and paste the next four filled like this:
51
51
51
51
Then below that the next four filled like this:
52
52
52
52
If its a macro that'll be required I'd like to to be able to change the number of rows to be repeated (4 in this case, but could change).
View 4 Replies
View Related