Change An Existing Macro
Apr 15, 2009
I would like to change an existing Macro……i.e. the current date……which is ,,,,,CNTRL +; …… I want to make it CNTRL + e………..I tried to make my own by running a new macro……but obviously I am doing something bass ackwards…..I tried to look up the current one……that is CNTRL + ; and see how they did it……but couldn’t find that either
View 2 Replies
ADVERTISEMENT
Nov 4, 2007
I am trying to make a change to an existing and working application. Right now, I read in a list of clients from my spreadsheet to my Userform. When the user (that's me as well) clicks on a name, (or names) the software takes over and does stuff with their biweekly payments. What I want to do is this: Not only show the names, but also the biweekly payments next to the names. The reason for this is some clients send in more than the assumed biweekly payment. As a first start, I changed my Initial function to read in two columns from my spreadsheet and not just one. The range name listbox_rwosource is d100:e112.
This is the only change I made. However, when I run the program - I still only see the names?
Public Sub InitMyUF()
Dim I As Integer
'UserForm1.ListBox1.RowSource = "current_clients"
View 9 Replies
View Related
Jul 11, 2012
Is there any way to change the border color of a cell by running a subroutine? Here is my example:
Col 1
Col 2
1
2
3
4
I have an existing table with data that is updated daily ... more rows are added. Currently, the cell border is black. I would like to run a macro such that the column header is shaded grey and the borders turn into a shade of gray. I am interested in the 35% grey.
View 4 Replies
View Related
Mar 7, 2014
I am looking for a vba where by the default colour of the font for new text typed in any cell of a workbook change to green or red and the default black automatic becomes secondary. The existing text in the workbook in its existing font colour must not change i.e stays in black or red.
View 1 Replies
View Related
Feb 9, 2007
I have Excel 2002. If I start the program it opens with a blank workbook, called "Book 1".
If I then open an existing workbook, I have two Excel buttons in the Windows taskbar: the one I just opened, and the blank one titled Book 1.
At work I have Excel 2003. The blank "Book 1" is also there when I start the program, but if I then open an existing workbook, the Book 1 goes away. I like this way better.
My question is: Is this just the way versions 2002 vs. 2003 work, or can I change a setting somewhere to make Excel 2002 close its default blank workbook when I open an existing one?
View 9 Replies
View Related
Feb 21, 2009
I have a data input worksheet, which uses the following code to fill in the missing zeros when cells are empty.
View 10 Replies
View Related
Apr 28, 2009
I have a routine that by clicking one button, that calls a macro, that currently opens Excel, or Word, or WordPerfect. The following macro uses a Case Statement looking at what the extension is, such as for Excel . . . xls
I have added a case statement for a shortcut . . . exe
View 4 Replies
View Related
May 31, 2012
I was wondering if there was a macro to add a row to an existing table. The table is on one worksheet and where i wanna enter data is on another.
View 2 Replies
View Related
Jun 12, 2008
I would like to have a single button that changes a range of cells from the USD to EURO to perhaps CAD symbol. Can this operation be performed, such that if I start in dollars, and I click the button once, it shifts by range to EURO (not formulas...just symbol)...and then if I click the same button again, it goes to CAD, and then back to USD with a third click?
View 5 Replies
View Related
Dec 30, 2008
Some expert users can unhide a sheet in a worksheet which is protected by password. But I don't want to place a button in the worksheet for everyone to see and wonder what it's for. I can record a macro and assign a keyboard shortcut but I can't do it it with existing macros ?
View 3 Replies
View Related
Mar 19, 2014
My macro essentially requires a deletion of the entire sheet, so I cannot run it through a button, it'd by definition be deleted. So I was thinking to run this macro through the keyboard, how to assign a keyboard key to existing macro?
View 4 Replies
View Related
Apr 2, 2012
Is it possible to overwrite an existing .csv file with
The command :
ActiveWorkbook.SaveAs FileName:=fName, FileFormat:=xlCSV
Or does it need to be Killed first ?
Plus do I need any of the options such as Create Backup, AccessMode As etc.
View 1 Replies
View Related
Mar 21, 2013
I would like to add a pause to the following macro so that it inserts the word CANCEL 1 second after triggering. I know I need to use the Application.Ontime function but cannot work out how to integrate it.
Code:
Sub Cancel() Application.ScreenUpdating = False
Sheets("Sheet1").Range("T5") = "CANCEL"
Application.ScreenUpdating = True
End Sub
View 3 Replies
View Related
Feb 12, 2008
I'd like to create a macro that can access few existing worksheets from different workbooks and print them automatically when i press the button or select them.
Tried userform and listbox that were suggested from other thread, but that didnt work quite well since I'm not quite understand the code behind it.
View 9 Replies
View Related
Mar 7, 2014
I have a named range "ABC", range is ("A1", "A3", "A5"). Now I need to use Macro to extend the range to ("A1", "A3", "A5", "A7"), that is, adding "A7" to the existing named range "ABC".
View 1 Replies
View Related
Jun 17, 2008
I have managed to create something similar to what i am working for using an example from Lacher and Gant Charts. i am now stuck as I can enter more than 40 status as it then gives me an error. The following is the code: Can any1 highlight where i need to make any changes to stop the error from occuring:
Option Explicit
Sub CreateTimeChartData()
Dim vTimeData As Variant
Dim i As Integer
Dim sRoom As String
Dim vLastEndTime As Variant
Dim oSeries As Series
' set up
Application. ScreenUpdating = False
Application.DisplayAlerts = False
' create chart data worksheet
With Worksheets("TimeData"). Range("TimeList"). CurrentRegion
.Sort Key1:="Room", Key2:="Start Time", Header:=xlYes
vTimeData = .Value
Worksheets.Add
On Error Resume Next
Worksheets("ChartData").Delete..........................
View 3 Replies
View Related
Jun 4, 2014
Attached is my sample data Sample Data_Combine Sheets.xlsm.
What the code in the attached sheet does is that it combines the data in Sheets Set1 and Set2 into the worksheet named "Combine".
Both input sheets share same columns. Code I use is as below:
VB:
Sub BuildPivotData()
Dim wrsht As Variant
Dim i As Integer
Sheets("Combine").Range("A2:AI500").Clear
wrsht = [{"Set1", "Set2"}]
For i = 1 To UBound(wrsht)
Sheets(wrsht(i)).[a2].CurrentRegion.Offset(1).Copy Sheets("Combine").Range("A65536").End(xlUp)(2)
Next i
End Sub
I want to amend the output in such a way that when the macro is run , in the "Combine" worksheet an additional column is added at the start(col A) with header as "Category".
The category should be nothing but the input Sheet name i.e Set1 or Set2.
Here is an example ... Output Sheet.xlsx.
View 3 Replies
View Related
Jan 26, 2009
I'm currently applying these formulae manually, and also instructing other people to do the same, due to my lack of understanding of macros. Hopefully someone can give me some instruction as to how to do this automatically. I'd like people to be able to open sheets sent as normal CSV's and apply a macro to get them into the right format, changing only rows with data in them.
These are the instructions I'm currently sending:
In cell n1 enter:
full phone number
in cell m2 enter:
=RIGHT("00000000" & J2,8)
Drag m2 to last record
In cell n2 enter:
=CONCATENATE(61,I2,M2)
Drag n2 to last record
In cell o1 enter:
Date of call
in cell o2 enter:
=DATE(MID(C2,7,4),LEFT(C2,2),MID(C2,4,2))
View 6 Replies
View Related
Dec 4, 2009
Just curios if this is the most efficient way to copy a workbook x number of times.
I tried copying 77 workbooks and not sure exactly how long it took, but about 2 mintues. The original workbook is 300 KB.
View 7 Replies
View Related
Sep 7, 2012
Is iy possible to create a macro to add a character to a cell with existing text, such as:
Progressive Insurance $
Where the name is in "whatever" font,color,format, and then the macro could insert the $ as pictured above different font,color?
I have played around with trying to write, or copy as image...with no luck.
View 6 Replies
View Related
Feb 22, 2008
I have the following macro which I use to transpose a number of columns in one sheet to rows in another sheet.
PHP
Sub task1()Dim i As Integer, n As LongFor i = 5 To Columns.Count Step 2 n = n + 1 With Sheets("Working_Checklist_1").Cells(10, i).Resize(16) Sheets("Summary_Intermediate").Cells(n + 2, "c").Resize(.Columns.Count, .Rows.Count) _ .FormulaArray = "=if(transpose(Working_Checklist_1!" & .Address & ")=0,"""",transpose(Working_Checklist_1!" & .Address & "))" End WithNextEnd Sub
I'd like to change this macro so to transpose from rows to columns. I've tried a couple of things, but can't quite get it to work.
I'd like to transpose every second cell starting from E7 to IV7 in Working_Checklist into column BU in Summary_Intermediate, starting from BU3.
View 9 Replies
View Related
Aug 6, 2009
i have a list of about 20,000 phone numbers that I need to edit.
all start
01 123456
01 123457
01 123458 etc
I am trying to create a macro that will change them to
+001123456
+001123457
+001123458 Etc
However, no matter what I try it always comes out as
+001123456
+001123456
+001123456
F2 Copy and paste is going to take me forever, and I am sure that there must be a quicker way to do this.
this is my first time creating macros so am completly lost.
I want to keep the text that is in the cell that I am editing, just add the country code and delete the space.
View 9 Replies
View Related
May 29, 2009
I can't get the Displayalerts = False to work as it's supposed to when analyzing data running the correlation add-in. (ATPVBAEN.XLAM!Mcorrel)
For each loop the alert is displayed which I don't want it to.
The code below is just an example. I have several rows which I will loop through and therefore the Displayalerts=False must work.
Sub test4()
With Application
. ScreenUpdating = False
.DisplayAlerts = False
.EnableEvents = False
End With
View 8 Replies
View Related
Oct 26, 2006
I have a user form with a TextBox (TextBox1), the user enters a filename and presses CommandButton1, this then opens the file. I have set an error trap so that if the file does not exist a MsgBox prompts the user to re-enter. So far so good, however if the error trap operates any further files entered are declared as non-existent even if I know they exist. I thought this would be quite easy but once again VBA bites me back!!
here is my code
Sub CommandButton1_Click()
stPath = ThisWorkbook.Path
stFilename = "Retention" & "" & TextBox1 & ".xls"
stFullname = stPath & "" & stFilename 'completes full path of for TextBox1
On Error Goto Errorhandler: 'go to this if file does not exist
Workbooks.Open stFullname
ActiveWorkbook.RunAutoMacros xlAutoOpen
View 6 Replies
View Related
Dec 23, 2009
I'm verrry new to editing VBA code and I've been trying to figure out how to send a column of data ("Min Data" AB3:AB21 from "Sheet1") to a worksheet ("F4" - Min) and sending another column of data ("Max Data" AC3:AC21 from "Sheet1") to a different worksheet ("F4" - Max) by using only the one button ("Record Data" from "Sheet1"
I've been trying to figure out ways to edit the VBA in "Module 1" to make this work
Can anyone help me out here? If what i'm asking for isn't clear enough, just let me know and i'll try to explain in more detail.
View 6 Replies
View Related
Sep 5, 2013
- Construct a macro to import a csv-file to my worksheet named "Info". The data in the .csv-file should start in row A5 in my worksheet.
- If the worksheet "Info" already has data, I want to overwrite the existing data with the new data starting in row A5
The directory of the csv-file is C:Testmycsvfile.csv
View 3 Replies
View Related
Jan 11, 2012
I've already found a TON of threads about this process but nothing that matches specifically what I'm trying to do.
I have a spreadsheet that I'm using to auto fill other tabs with data that only matches specific criteria. Here's what I'm looking to do:
Columns I, J, K, and L may be marked as either Y or N (or blank). I have different sheets that require 1, 2, 3, or 4 of those columns to match Y. For example, on sheet 2 I want to copy the entire row if there's a "Y" match on column I and J. On sheet 3 I want to match "Y" against, I, J, and K. Sheet 4 I need to match only L, etc.
I need the data copied into the existing sheets to start on row 7. I have other data on rows 1-6 that cannot be moved.
I'm running Excel 2007.
View 5 Replies
View Related
Mar 17, 2013
I have attached excel with the logic I am using, but I have a problem and needed logic to update to make sure it is not inserting same data (duplicate data).
Please update the logic so that if it is having same data in sheet 3 it should not insert or delete duplicate.
Code:
Public Sub CopyData()
Dim ws As Worksheet, bi As Byte, vData(1 To 9), bi1 As Byte, vData1(1 To 9), bi2 As Byte, vData2(1 To 9), bi3 As Byte, vData3(1 To 9), bi4 As Byte, vData4(1 To 9)
Set ws = Sheets("Sheet2")
For bi = 1 To 9
[Code] .........
View 3 Replies
View Related
Sep 19, 2013
I have been using this code and just noticed that it resets all of my options buttons to false when I exit and then re-enter (activate) the sheet with the option buttons.
I see where this is going on, but don't know how to correct it. I only want the option buttons changed to false if
The Sol named range is something other than "Primary Vendor". It seems to call the macro ClearOB whenener the sheet is activated.
Private Sub Worksheet_Activate()
If Range("Sol").Value = "Primary Vendor" Then
For Each OB In ActiveSheet.OptionButtons
OB.Enabled = True
Next OB
ClearOB
ActiveSheet.ScrollArea = "A1:K58"
[Code] .......
View 1 Replies
View Related
Jul 11, 2014
I need to be able to export a project list to Excel and overwrite the contents in an existing Summary Report with the exported list. Is this possible? I am using SharePoint 2013 and Excel 2010.
View 4 Replies
View Related