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.
On the "If not Isempty" line, I am trying to input a box prompt. Instead of standardizing this macro, I want the user to be able to select a dollar amount to search and place on sheet3. Right now it works fine using 1.29 as the amount. However, I have other stores where this dollar amount is different, so I want the store managers to be able to choose an amount to search, for example 1.39, 2.99 etc...
I copied this snippet from the net and it has been working like a charm. I would like to add DateLastModified to it, but I can't get it to work, I'm still kind of new to more complex VBA codes. Here is the code...
Code: Private Sub CommandButton1_Click()
Dim cell As Range Dim selcell As Range Dim Value As String Dim Folder As Variant Dim a As Long
I need a code to use existing IE tab to pass different queries on google search.
For example:- If active cell contains "manoj Kumar" then macro will search "manoj Kumar" on google and if i select another cell then code will pass the another google search query on the same active IE window(It will not open new window or new tab).
I use for another template and it works fine. Only change I would like to make is the column headers starts in Row 4. Col B. Some how this is not working for me.
Sub ITD_REV()
Application.ScreenUpdating = False
With Sheets("Data").Rows("1:1") Set c = .Find("CONTRACT #", LookIn:=xlValues) If Not c Is Nothing Then FirstAddress = c.Address Do c.EntireColumn.Copy Sheets("Test1").Select Range("B3").Insert shift:=xlRight Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address FirstAddress End If End With End Sub
Again...incase what I said does not make sense: I want to copy certain columns with fixed header names, e.g. "CONTRACT #" into another sheet name "Test1" and paste starting into cell B3. Another column would be "Contract Name" and so on. Also, these col header names may not be in order. In "Data" sheet, col header names starts in row 4.
I have already got an anwer for this long back from this site. The code was writted by Mr. Krishnakumar the thread is here :[url]
i need some changes to be made in this code. The existing code creates and updates the details in the sheets automatically from the master data. I just need the sum of Column I in all the sheets after the last row of Column I.
selecting all the sheets and typing the formula in I column is not possible because, the last row in Column I is different in all the sheets. In sheet 1, the last row of Column I is Row 15, in sheet 2 Row150 is the last row. I guess something could be done in macros.
follwing is the existing Sub TestIt() Dim sWS As Worksheet Dim Sellers As Range, Seller As Range Dim lRow As Long, fRow As Integer Dim CopyRng As Range, ws As Worksheet
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..........................
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.
I have two sheets - sheet1 and sheet2. Everytime i run a macro in the sheet1and manually copy the rows from sheet1 {starting (A2:AI2)} and paste as values it in the sheet2 {starting (A2:AI2)}.
Then I ll delete the available datas in the sheet1 and will run a macro for different customer.
Again I need to repeat the same action (manually copy and paste the datas to sheet2) without replacing the existing data in the sheet1.
In simple I require a macro code where it copy the available information in sheet1 and paste it as values in the sheet2 without replacing the existing one.
How to amend existing code in a workbook that is used by many different users. I am working in Excel 2003. The existing code copies data from certain cells in the active worksheet (which is password protected) into a new worksheet and saves that new worksheet to a temp folder, sends it to a particular email address using outlook and closes it, returning the user to the first workbook. You will see that it also unhides then rehides columns of the first worksheet during this process so that the user never has to see them. Problem here is that none of the users are using outlook anymore and I would prefer that this new spreadsheet that is created just be saved to the users desktop. I have found bits and pieces of what I needed on the web, but I can't seem to put it all together (I usually end up being sent to the debugger just short of having the newly created spreadsheet saved to desktop). Here is the existing code:
Private Sub CommandButton1_Click() Range("A2:G2").Select Selection.ClearContents[code]....
Essentially what I need to do is circumvent the whole email bit and save the spreadsheet that is created to the users desktop instead of a temp folder.
I would like the following code to be run for all those sheet/s that has a name = "single" (Not case sensitive neither an exact match) of my active workbook.
Code: Sub UIUIUI() Dim LR As Long, i As Long LR = Range("I" & Rows.Count).End(xlUp).Row For i = 1 To LR With Range("I" & i) If .Offset(, -1).Value = 1 Then .Value = .Value & "-" End With Next i End Sub
I have a code now that in excel, when the button is clicked, will put file into a new email and format the email.
What I have been trying to do, is make it so that if Cell C10 is blank, you get a prompt telling you it must be filled out before you can proceed with the submission.
Here is the code now:
Sub SendTimeCard() On Error GoTo err_handler Dim OutApp As Object Dim OutMail As Object
Dim subject As String Dim body As String ' Be sure the workbook is saved first ThisWorkbook.Save
I have some existing code which I did not write, nor do I have the expertise to update. The macro code takes multi rows of data for one person and "flips" the output to be one record per person with columns of data.
The source data looks like this sorted by teacher, Term and Period (columns H and I are the new ones added; the code currently looks through column G only)A
Faculty Name B Periodc C
[Code]......
I just want to add column H and I data to the period course listings by term. So instead of "Term: TM#", just have the display indicate Termcode: Tally/SectSize.... such as (example): "TM1: 20/30"
My Code is as follows:
Option Explicit Dim wsSource As Worksheet Dim wsTarget As Worksheet
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.
I have a workbook which contains 8 worksheets. I want to able to run a macro that looks for specific words in column A of each worksheet and hides any rows in between the specified words. The following code works except if a worksheet does not contain the specified words. Is there a better way to accomplish this?
Attached is an example of the spreadsheet. The code below works just fine on the tabs highlighted in green, but halts on the tab highlighted in red. The tab highlighted in yellow is showing you the rows I need to hide.
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
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.
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: ....
I inherited a spreadsheet to manage that is linked to a SharePoint table.
It is trying to populate a date that a certain "Tier" is selected (1, 2, 3, or 4).
It works great if I manually type in the tiers, but does not run on existing data (about 400 records) or lines that are updated and new via the SharePoint list.
How can I have this run on all of the existing lines and anything added or changed in the future from the list?
VB: Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("AD2:AD10000")) Is Nothing Then Application.EnableEvents = False
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.
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]....
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.
The amazing code I saw was from this thread Auto lock cells after data entry when file saved... where the code was made by Jafaar Tribak.
It basically locks cells that have had data inputted into them when the file is saved (with a nice prompt warning of the used cells being locked.
This is Jafaar's file [URL]
And this is my file where I'm trying to make it work in the "Employee data entry" Sheet:
[URL]
And finally this is the file after I tried to copy the code over : [URL]
Trying to make it so that in the employee data entry sheet locks cells after an employee inputs some data into said cells.
I thought that by setting an "inputrange" on the employee data entry sheet the code would track it down automatically but maybe I'm completely wrong. I cant see anything wrong with it (probably because I"m not that good at vba) but I fear I may have left out something really simple!
I seem to disable my other macros when i try to insert this code in (I have a macro that when you click on a cell a calendar pops up so you can click on a day from the calendar rather than typing out the date)
I use excel 2002 but some of my office are on 97, i want to add a small workbook open event code which works for me but debugs for the others?? The code is basically, go to a tab, on that tab and that range sort..
I've developed a little software using Excel Macros & VB. To prevent people from accesing the code I protected the code blocking it from visualization. It seems not enough as an acquaintance of a friend cracked it in 25 minutes. Or so he says. So I'd like to know if there is a better way to protect the font code.
My situation is as follows: I have multiple workbooks that each contain three worksheets, the worksheets from one or more of these workbooks needs to be added to another workbook.
Since the worksheet names in all workbooks are the same, I need to add the data from a cell (account number) in the file to the existing worksheet names. Using the attached file as an example, the value of cell A8 on the DMC-UPS-Summary worksheet needs to be added to each worksheet name in this file.