Macro - Merge & Modify Formula

Dec 17, 2009

I use the merge button a lot for a group of cells in a column. However then I have to edit the formula in the merged cells.

I'm hoping there is a macro that can be made to bring these together.

Here's an example of what I do:

select range C2:C4. Cell C2 contains the formula =sum(B2)
merge these cells.

edit formula in new merged cell to be =sum(B2:B4)

Can I group this process into one macro?

View 9 Replies


ADVERTISEMENT

Excel 2002 :: Modify Formula To Merge Numerical With Text

Apr 21, 2012

I am using the following formula to find out the No. of "HH" in the range given and I am getting the results simply with numerical value as 2, 3 etc. I want the result should be displayed as 2HH, 3HH depending upon the No. of "HH" available in the given range. The result should be displayed as (the No. added with the text "HH").

=IF(AND(DJ10="HH"),COUNTIF(DF10:DJ10,"HH"),"-")

I use excel 2002.

View 2 Replies View Related

Add 2 Conditions To Formula Or Modify Existing Formula?

Dec 22, 2012

I'm trying to add either a new condition to a formula or modify existing formula, so blank cells can't be taken as a number like 0 Here is the formula =IF(N14>0,1,0)

***This is what I do with formulas with similar problems =IF(COUNT(Y14,A14)=2,Y14/A14*100,"")

unfortunately the above condition its already a condition by itself so I don't know what to do whether to modify condition or add a new condition which I don't know how to do.

View 9 Replies View Related

Modify Formula From Sum To Count

Aug 8, 2008

Hi I have these formulas that look in a specific column and if the argument is true then it sums the numbers in the same row but different column.

I need it to count instead of sum. These are array formulas so in order for them to currently work you must press ctrl shift enter.

{=SUM(IF('sheet1'!I7:I510>D7,'sheet1l'!G7:G510,0))}

{=SUM(IF( 'sheet1'!I7:I510>B8,IF( 'sheet1'!I7:I510

View 9 Replies View Related

Modify Series Formula

Jan 2, 2009

I'm constructing a dynamic chart and I'm having difficulty naming the series formula.

I wish the Y values to pick up values in a different sheet and have entered the following formula :
=Rnd4Projects.xls!,Timeline!ChtYLeics

Workbook is called Rnd4Projects and the data is contained in a different sheet, called Timeline.

However, I keep getting an error message to say there is a problem with the formula. how this formula needs to be entered in Series Values box?

View 9 Replies View Related

Modify Formula That Calculates Time?

Jun 6, 2014

I have the following formula:

=TEXT(D2-C2-TIME(,60,),"[h] h
s: m mi
s")

It's taking out 60 minutes for lunch. Now I want to use this to calculate straight time and not deduct any time. How can this be modified?

View 13 Replies View Related

Modify Formula To Dynamic Range?

May 29, 2013

I need to use the valve in the last row in column 27 and subtract the value in column "Y". Looking to modify this "R37C27" to dynamic range

Range("AG1:AG" & lr).FormulaR1C1 = "=IF(R[2]C[-13]=""Nanner Table"",R37C27-RC[-8],RC[-6])"

View 1 Replies View Related

Increment/Modify A Formula Using Macros

Jul 22, 2006

I am needing a macro to modify a cell reference contained in a formula. For example: I have "=B2" in a cell of my worksheet, and I need some code to select and increment that by 1 so it becomes "=B3". I know how to use the ActiveCell.Offset command, as shown below, to select a specific cell so that it can then be modified, but I can't figure out how to make the actual change. ActiveCell.Offset(rowOffset:=0, columnOffset:=-1).Select

View 3 Replies View Related

Run Two Macro When I Modify One Value In A Cell

Feb 9, 2009

I need to run two macro when I modify a value in a cell

Here is the code for the macros:

View 14 Replies View Related

Macro To Modify Several Worksheets

Jun 21, 2013

Due to the lack of time and not being able to make it work otherwise this is what I have right now:

If Range("g59") = 1 Then

Sheet1.Activate
Application.Run "Edit_view"
Sheet3.Activate
Application.Run "Edit_view"

[Code] ...

There was a formula to enter sheets names in a cell range (ie: A1 would have value SHEET1, A2 SHEET2, etc) and use a FOR loop to cycle through the named sheets.

View 1 Replies View Related

How To Modify Source Data When Using VLookup Formula

Dec 17, 2013

I have 2 sheets, lets say SheetA1 and SheetA2. I am using Vlookup to serial number & getting data from SheetA1 to SheetA2. But I want to modifty the data. If i modify the data in SheetA2 that modification should relect in SheetA1. Is it possible...

View 5 Replies View Related

Modify Macro To Add Hyperlink To Worksheets

Oct 4, 2012

I have this macro that I use for taking information based column B grouping it together and putting in a separate worksheet.

What I would like to do is in the master sheet (sheet1) to create a hyperlink for those listed in column B so I can click on it and it takes me right to that worksheet.

Sub exporttoWS()
Application.ScreenUpdating = False
Dim i As Range, LR As Long, ws As Worksheet, wb As Workbook, C As Range
Sheets("Sheet1").Select
Range("A1").Select
'looking at the full length of the file
LR = Range("A" & Rows.Count).End(xlUp).Row
'sheet needs to be named sheet1, all data should begin on row 3

[code].......

View 3 Replies View Related

Modify Macro To Use File That Changes Name-monthly

Apr 20, 2007

I have this macro that I am using but want to automate the file it uses. This file has the last 5 text/digits change each month, e.g.

Internet_GB_Report_Feb07
Internet_GB_Report_Mar07

Clearly the next file would be Apr07. I would like the macro to identify this automatically and use the correct file without having to go into the macro every month and change the last 5 text/digits. If you have any ideas I would be very grateful to hear from you. The Macro is below:

[/code]strPath = "c:Internet"
strFilename = "INTERNET_GB_FEB07"
strThisWkb = ActiveWorkbook.Name
intReports = Workbooks(strThisWkb).Sheets("Lookups").Cells(1, 2)
Code:

View 9 Replies View Related

Modify Macro That Deletes Rows

Aug 20, 2008

i have this macro made by another member here that looks for "T" in column 10 and deletes entire row if in that row has a "T". I need it modified to also delete if it contains "FT" and also erase if cells is blank.

Sub Macro8()
Sheets("FORMERS").Select
'deletes entire rows based on a text on one row (this case errases all that have a "T" in column 10 (column J)

Dim DeleteValue1 As String
Dim rng1 As Range
Dim calcmode1 As Long
With Application
calcmode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With...........................................

View 9 Replies View Related

Modify Formula Containing Consecutive, IF Statements To Enable Drag-down

Oct 8, 2008

I can drag it down to fill a series of cells within a column.

Let's say the formula in cell A1 is:

View 5 Replies View Related

Modify Macro To Give Myfilename Ddmmyy_hhmmss

Dec 9, 2008

Is it possible to modify this macro below to concatenate what is in cell B4 (myfilename), with B5 ( =now() )and retain the correct time date format that I have specified (I formatted the cell so that there were no / or : in the file name i.e.ddmmyy_hhmmss)?

When I try this the file name always reverts to the microsoft date "serial number:
I would like myfilename 09122008_1851

but instead get myfilename 39792

(or would it be better to include the date and time in the macro rather than in the cell?)

View 6 Replies View Related

To Modify User Defined Function Macro

May 8, 2007

The below macro(found in VBA and MACROS for Excel) works well but I need a few modifications

Option Explicit

Function SortConcat(Rng As Range) As Variant
'Rng —The range of data to be sorted and concatenated.
Dim MySum As String, arr1() As String
Dim j As Integer, i As Integer
Dim cl As Range
Dim concat As Variant
On Error GoTo FuncFail:
'initialize output
SortConcat = 0#
'avoid user issues
If Rng.Count = 0 Then Exit Function
'get range into variant variable holding array
ReDim arr1(1 To Rng.Count)
'fill array
i = 1

1)My array is 128 cells wide(AT3:FQ3) and i get a type mismatch--seems to work well for 36 cells

2) These cells contain dates and numbes---all i want to sort and/or display is the numbers
Note: some numbers are in parenthesis and other are either single or double digits. Example: numbers are (8/8),8,10,(HG6),4,6,etc. And Dates are 04/06 format (no year, and no parenthesis)

3) All empty cells in the array show up in the above SortConcat function as zero, and are un-necessary

4) The final output should be no more than 6 concatenated numbers, so column width is not an issue, and the bubble sort is really not necessary but would be a nice feature

View 9 Replies View Related

Protect Sheet But Allow Macro Code To Modify

May 24, 2008

I am trying to design a tool which dynamically results in different cells depending on users inputs. Yet, I am willing to protect most of the cells to avoid any user involuntarily (or voluntarily!) modifying the formulas/contents of the calculated (and locked) cells. Is there any way to protect my sheets, allowing only a certain macro to modify the locked and protected cells?

View 4 Replies View Related

Excel Macro To Modify Hyperlink To Copy And Paste

Feb 15, 2014

I have a workbook that has 2 worksheets. Sheet1 has a data table that is filled from an SQL database. I would like the first column of the data table to have each cell be a hyperlink. The destination of the hyperlink is Sheet2, cell A2. I would like to modify the hyperlink, so that when the user clicks on the hyperlink, the text-display of the hyperlink is copied into sheet2 cell A2. Initially, I thought this was simple. I added the event code shown below:

[Code] ........

This worked, however there was a problem. I manually added the hyperlink to all cells in column1 of sheet1. However, this made the TextToDisplay property the value of the first cell for all hyperlinks. So, solution to add hyperlinks to all cells in the first column, with TextToDisplay property set for each individual cell. What is the best way to do this with the fact that the number of rows in column1 will vary as the size of the SQL query changes?

View 1 Replies View Related

Modify Macro To Paste Results To Last Empty Cell

Feb 21, 2014

I have this macro and at the present time, can only compare two worksheets. One of my worksheets contains column headers with data, the other worksheet just contains column headers. The macro will match the data against the column header and paste below. I'm doing it this way because I have several tables I export from a MySQL database, but some of them have more fields than others so I was trying to get all of the data to line up in under the correct column header from each table. I need editing the macro to allow for

1) More than one worksheet to be analyzed at a time
2) If the first request is not possible, I would like for the macro to paste results at the next empty cell. As of now, it will only copy one at a time (which requires me to house the data in another worksheet everytime I run the macro).

Below is the code:

Dim ws1 As Worksheet, ws2 As Worksheet
Dim HeaderCells As Range, Hdr As Range, hdrFIND As Range

Application.ScreenUpdating = False 'speed things up
Set ws1 = ThisWorkbook.Worksheets("HEADERS") 'Define name of worksheets
Set ws2 = ThisWorkbook.Worksheets("B")

[Code] .......

View 1 Replies View Related

Modify Macro To Check And Turn Off Sheet Protection.

Dec 14, 2009

I am using the macro below to import every spreadsheet into a folder. I would like to modify it to check the sheets it is importing for sheet protection. If the sheet protection is turned on, I would like it to turn it off. The password for the sheet protection will be "PIR".

View 3 Replies View Related

Modify The Formula Entries In The Following Code To Cycle Or Loop Through All Checks Required

Feb 22, 2009

I'm working on a spreadsheet to compile and print checks. All the check information except the date and first check number is contained in a Wins sheet. I also have a Checks sheet which contains a master check. I used text boxes on the master check to contain individual check information. Each text box is filled in from the Wins sheet by means of formulas. The problem I'm having is how to modify the formula entries in the following code to cycle or loop through all checks required. A sample spreadsheet is attached.

View 2 Replies View Related

Modify Macro In Excel / Transpose - Delete Contents - Skip X Rows - Repeat?

Mar 7, 2013

I have a list in Excel, and it has the company in one column, and it's information in the next x rows until there is a blank row (4-7 rows). I get that you can copy the rows under the Company, transpose next to the company, and then delete the contents of the cells that you just took the data from, but I have 6200 rows do to this to, for 500+ companies. I tried recording a macro for two entries, and this is what I have (see below), but how do I modify this so that I don't need to type in every single range, and it will do it to the whole column? The data is in column A, I am posting in column B.

Basics for Macro Requirement:

1. Find the blank cell in row A
2. Skip the next cell/row (this is the company)
3. Select all the cells beneath the company cell, until it reaches the blank cell underneath
4. Copy, transpose these cells next to the Company cell (transpose in column B)
5. Delete the contents in row A that were just transposed
6. Find the next cell with data (company)
7. Repeat Steps 2-6

My recorded Macro:

Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+q
'
Range("A3:A8").Select

[code]....

View 5 Replies View Related

Formula To Mail Merge

Jul 28, 2008

I have a sheet of 2000 rows. What I want to do is merge the information into a word document with 8 rows of information on each sheet. These will then be printed and guillotined. what I want is to have the information for the second row to appear under the first one and so in position 9 and the third under that in position 17 and so on so I can just stack the piles up and they will be in order rather than having to sort them all into order. I do not know if there is anyway of tell word what oder to put the records in or if I will have to use a formula in excel.

If I have to do it using excel I need to be able to have a separate column which i can sort and it will then be in the right order for the merge. The first row will be 1 then 9 then 17 (adding 8 each time) up to row 50. Then row 51 is 2, 52 is 10, 52 is 11 up to 100. Then row 101 is 3, 102 is 11 and so on and so on.

View 14 Replies View Related

Merge 2 Macro's Together

Jul 21, 2007

I have two macro's that I need merged together. Specifically, the macro Find75 is run first which produces a new sheet, Peaks Found, and then normally I would run the kTest macro to give the Final Results sheet. Need to get this all into one macro? Thus one macro to run would produce the final results sheet, without producing the intermittent step of producing the Peaks Found sheet.

View 2 Replies View Related

Concatenate Formula (merge Cells)

Oct 14, 2009

I am trying to merge cells A1:GR1 in to one cell by using the concatenate formula and the copying and pasting the values in to the same cell.

View 4 Replies View Related

Worksheet Merge Macro

Nov 18, 2009

Disclaimer: I know almost nothing about VBA or Macros. I started with them yesterday. I took the following code off Ron de Bruin's website. I am attaching his example spreadsheet. When you click on Test 2 it does everything I want BUT copy the header row over. The workbook I want to apply this too has 12 sheets++ which have the same exact columns and headers, but different row counts. Ron directed me back to his site and the following code:

View 3 Replies View Related

Macro To Merge Cells

Feb 7, 2013

I have a range of data, that I need to setup a smart macro for, but I need the macro to do the following:

Merge Rows if Column G is the same, merge shall be done in Column A, C, D, E, F, G, H, I, J, K, L, M, N, S, T, U, V, W, X, YNo Merge: Column B and O, P, Q, RMake SUM in Column L, M, N for column O, P, Q. The macro to run for the entire sheet, until first empty cell in column G

A
B
C
D
E
F
G

[Code]....

I have tried with a Pivot, but it doesn't work out, as I need to be able to make changes to all cells after the "merged" cells has been done.

View 9 Replies View Related

Cell Merge Macro

Apr 12, 2006

creating a macro in excel that will merge data based on matching id's.

The spread sheet looks something like this

A B C D E F ...
1 12 X 12 2 1 4 ...
2 13 X 17 3 4 4 ...
3 17 X 21 1 1 2 ...
4 21 X 22 2 1 3 ...
.
.
.

I would like to move Cells C2,D2,E2... down to where
the number in column A = the number in Column C
So in this cas C2-End of the sheet where there is data will move down one row, and the same with C3.

View 3 Replies View Related

Merge Data Macro

May 25, 2007

I have been using the following code to fill data down a col. For example if a1=blue and a5=green and a7=red. The macro will fill a1(blue) down to a4, then take a5(green) to a6, then a7(red) etc.

Sub Filldown()
If ActiveCell.Text = "" Then
MsgBox "please start with a non-empty cell"
Exit Sub
End If
For Each x In Selection.Cells
If x.Text = "" Then
x.Value = x.Offset(-1, 0).Value
End If
Next x
End Sub

code works great, but I was hoping it could be changed so that instead of filling the data down it would merge the data down. So, in the example, a1:a4 would be merged leaving the word blue, a5:a6 merged, and a7:etc would be merged.
Is this possible?

View 3 Replies View Related







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