Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all 49981 articles
Browse latest View live

VBA Macro - Keep Track History - Shared Files

$
0
0
Hi guys,
Been following for a long time but can't find any solution. Hope you can help me, again ;)

Work with 4 shared files on the company server everyday. 13 co-workers make changes on them.
Sometimes i need to unshare them (for ex: to add data validation or conditional formatting), and as you all know, the Track History vanishes.

What I need is some help on making a Macro that allows me to keep the history on a file on my own Desktop, on a folder named "Backup" (called "Tracking History.xlsx".

Something like a log.

Tried to use http://www.ozgrid.com/VBA/track-changes.htm but haven't done what I expected.
Many thanks

Macro to read excel files and sort data according to groups and sub groups in one workbook

$
0
0
Hi. I need help to solve my problem. I want to create a macro VBA that able to read the excel files and sort it in a structured manner in a new workbook. The macro will read the group first then it will read the sub group and stated which one are top level first. Here i provide 3 example files that the macro would read and the output i wanted it to be like the output file i uploaded below. Much appreciated if you can help me. If you not understand you may ask me.

Thank you.

Regards,
Afandi
Attached Files

Add multiple attachment in outlook with 2 conditions

$
0
0
Hi,

need your assistance editing my existing codes, i been working this for 2 days and I'm at my end.

I need to attached invoices copy in column 4 if per customer code in column 2

i have attached file i am working

Thank you.
Attached Files

Add multiple attachment in outlook with 2 conditions

$
0
0
sample.xlsm

Hi,

need your assistance editing my existing codes, i been working this for 2 days and I'm at my end.

I need to attached invoices copy in column 4 if per customer code in column 2

i have attached file i am working

Thank you.

i cannot post, i received error

add Multiple attachment to outlook mail with 2 conditions

$
0
0
Hi,

need your assistance editing my existing codes, i been working this for 2 days and I'm at my end.

I need to attached invoices copy in column 4 if per customer code in column 2

Capture.PNG

Sub a()

Dim ws As Worksheet, str$, spath$, sfname$

Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Dim objNameSpace As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")

Set objMailItem = objOutlook.CreateItem(olMailitem)

Set ws = Sheets("Sheet1")

'For i = 1 To Range("A" & Rows.Count).End(xlUp).Row
irow = 2
iirow = irow + 1

'Do While Not Sheet1.Cells(irow, 2) = "" And Sheet1.Cells(irow, 1) = ""


'iirow = irow + 1
'Do While Not ws.Cells(iirow, 2) = "" And Not ws.Cells(iirow, 4) = ""

Set objMailItem = objOutlook.CreateItem(0)

attch = "C:\Users\aac059\Documents"
attch = attch & "\"
iattchname = Range("D" & irow) & ".PDF"

With objMailItem
.Subject = Range("A" & irow) & " " & Range("B" & irow) & " " & Range("C" & irow)
.Body = ""
.Recipients.Add Range("E" & irow).Value
.Display
Do While ws.Cells(iirow, 2) = "" And Not ws.Cells(iirow, 4) = ""
.Attachments.Add attch & Range("D" & irow) & ".PDF"
iirow = iirow + 1
Loop
End With

'objMailItem.send

'Loop
End Sub


Thank you.

Value of Dropdownlist to be entered in another sheet

$
0
0
Dear All,

Gud Afternoon!!!

I can play with excel with any formulas but doesnt have VB Knowledge. So request someone to help me

I've 4 Dropdownlists in Sheet1 H4, H6, H8 & H10 whose details are the headers in SSR Sheet

i.e., If I select location as Delhi, Model as CB600MM-OPW-WOR, Dispatch Type as SSR & Quantity entered here to be entered in that particular cell of SSR Sheet as per the selected details in Sheet1 dropdownlists

I know this can be done but cannot be done with formulas, so seeking someone's help who can do this for me

Best Regards
Anil
Attached Files

display relevant info in one combo box when selecting a value from another combo box

$
0
0
Hi there

I am in need of some expertise. I have been working on this form project and need some help coding the combo boxes.


I've been busy with the combo boxes in this particular project. Is there a way to populate a 2nd combo box with only relevant information? I am working with VB for this project.

E.g I have a department combo box. When I select "IT", I want the employee combo box to only display all the "IT" personnel.
Something along these lines:

Code:


If cboDept.Selected(0) = True    Then                                           
 
  cboEmp.ListIndex = (0) & (1)                                   

End If

An idea of what I want the action to perform. Now I am not quite sure how to implement all the coding. I have tried many options yet none work.

Any and all help would be appreciated.

Weekly Workload Tracker - VBA Alternative??

$
0
0
Hello all!

I have inherited a workload tracker that tracks the whereabouts of staff over the course of the months/years. Whatever job they are assigned to and for how many days is plotted onto a table with days/dates down the left (shown as weeks) and names across the top.

When I inherited it, there was a formula in every box of the table to work out whereabouts - this meant there was huuuuuge amounts of it and the spreadsheet was taking a long time to open and run.

Is there a VBA alternative to formula? This would speed up the document no end. I've attached a sheet if somebody is free to take a look?

To briefly explain the document, a job is entered on the first tab and this job should then populate the table on the second tab. I've pre-populated with an example line.

Many many thanks :)
Attached Files

Macro that will adjust to a user screen resolution, once file is open.

$
0
0
Looking for a code that will automatically adjust to a users screen resolution, once they open up the Excel file. What I have already is:

Code:

Private Sub Workbook_Open()
Range("A1:V1").Select
ActiveWindow.Zoom = 100 (Tried replacing the 100 with True, and it's still no adjustment)
Range("A1").Select
End Sub

Transpose multirows from two column into single row with one header

$
0
0
Hello All,

Hope you have a great time.

I am trying to transpose data in multi rows from two column into single rows with one header.
Attached is the macro mockup, need small adjustment, because it's only transpose first column.
Code:

Sub TransposeAreas()
    Dim aArea As Range
    Dim nr As Long
   
    Application.ScreenUpdating = False
    nr = 1
    For Each aArea In Range("A1", Range("A" & Rows.Count).End(xlUp)) _
                .SpecialCells(xlCellTypeConstants).Areas
        aArea.Copy
        Cells(nr, 3).PasteSpecial Transpose:=True
        nr = nr + 1
    Next aArea
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub

Thank you.
Attached Files

Values of cells to be routed to other sheet

$
0
0
Dear All,

Please refer the attached excel Sheet1 Columns F & G

Location is a dropdownlist where I've made search suggestion with formulas

Dispatch Type is another dropdownlist with only 2 values

Model is a custom data validation formula which minimizes the values of F14 to F48 i.e., If I type 600 in G10, it will display values of only those values which contains 600 from F14 to F48

Requirement of Quantity button:

1. When I select location, Dispatch Type & particular cells in F14 to F48, Enter quantity in G14 to G48 (based on the values minimized in F14 to F48), Those quantities or values to be routed to SSR Sheet to the particular cells

2. Message box has to be displayed with models that I selected and total quantity of those models after summing up the values

3. if you have any thoughts with better improvements, Please do & let me know. But not manditory :)

Request you to please help on the above requirement and do the needful.
Attached Files

Macro for moving multiple rows/columns with different criteria to different sheets

$
0
0
Hi,

I have been visiting this site for quite some time and really enjoy it. I appreciate everyone's help and have learned a lot...but this is my first post so sorry if it is confusing, or if it has already been mentioned somewhere. I have searched and not found anything about my problem, or maybe I am just phrasing it incorrectly...anyways here goes

I have the below information in 1 worksheet...and obviously there would be more rows columns data etc... I need to move each person to a new sheet, but keeping their characteristics(products,sales,weight etc...) with them too. I found a macro that moves each person and the data into a different sheet, however the headers in each next sheet is always the same as for Scott for example...but I want Kimmy in the next sheet with those headers and their data that are specific to her(products,type,day,sales) and the same for Rick and anyone else who comes after. Right now I am not sure if there is a space between the peoples names when I run this report in our system, I don't know if that makes a difference.

Is it at all possible to achieve what I am asking for?

city days products
Scott London 2 19
Scott Hamilton 8 32
Scott Sydney 1 7



products type days sales
Kimmy 45 single 18 15000
Kimmy 10 multiple 12 25000




Brand Weight City
Rick Oroblam 150kg Athens
Rick Lomlup 0.15kg Vienna
Rick Tohs Gib 100kg LA

Populating an array using only one row of values

$
0
0
Hi all,

I have a problem with an array I have. I need to populate it with numbers, but I have no idea how to do this.

I have the following numbers in 4 horizontal cells:

120.9 130.5 130.5 120.3

Together with another table, also with 4 horizontal cells:

0.0 12.2 14.4 16.8


This needs to be converted into the following table:

120.9 133.1 135.3 137.7
118.3 130.5 132.7 135.1
116.1 128.3 130.5 132.9
103.5 115.7 117.9 120.3

As you can see, the values from the first table are diagonally presented in the third table and subsequently the adjacent cells are calculated, using the difference between the values in table 2. To the left = - to the right is + but also from top = + to down = -. (+ = underlined / - = italic)

Can someone help me with the VBA code for this? It will most likely need to be extended to an array of 20 x 20.

Many thanks in advance,
Martijn

Extract Report

$
0
0
Dear Experts,
Please find attached an example firle where i like to extract report (from protected sheets) in to a new workbook

Please help

Regards
Attached Files

Extract from one row multiple & non-fixed rows

$
0
0
Hello everybody
I have a Data sheet with merged columns (not all merged just some columns)
In sheets("Results") I need to extract from one row in sheets("Data") to multiple rows in sheets("Result")
I have attached the expected results for just one row (row 2 in sheets("Data")) .. and other rows would be extracted as that row

I prefer using arrays as I have about 10,000 rows in sheets("Data") and each row of course will be splitted to multiple rows (not fixed .. these splitted rows would be changing according to the number of name)
For example in row 2 I have six names so the row would be splitted into six rows..

Hope it is clear
Thanks advanced for help
Attached Files

Automatically bold certain phrases within a cell

$
0
0
Hi all

I am an Excel novice and have so far learnt to make the attached spreadsheet. It is for automatically calculating reagents I need in my chemistry experiments, so I have three worksheets: a 'database' of reagents, the calculator itself, and a summary page (which I will eventually format so I can print it).

In the 'Summary' worksheet I want to highlight certain phrases in bold automatically - and from a quick internet search I think I will need to use a macro. I have found some suggestions online but cannot get any to work.

In cell C24 I have some phrases, such as 'R1-Explosive when dry' and 'R2-Risk of explosion by shock, friction, fire or other source of ignition', and would like to know how to bold these phrases individually as and when the cell is populated with a list of phrases.

I would like certain phrases to be bold, and not others, as I would like to only highlight the more dangerous phrases.

Anyone have any ideas how to solve this problem?

Thanks
Attached Files

Need Help Auto-Sorting A Spreadhseet

$
0
0
test3.xlsm

Essentially need to be able to add a row of data without the other data in the spreadsheet shifting. I tried to explain it better in the attachment.

Any help is greatly appreciated.

VBA copy table from a web page

$
0
0
So I have a table on a webpage that I need to have copied via VBA but not sure how to. I've seen other threads but they don't match with hat I am trying to accomplish, or are only partially completed. The table is named "data". I've got VBA set up to access the webpage and navigate to the table, I'm just not sure how to copy the table to a worksheet.

I want to stay away from Data Import options.

Any ideas?

disabling the windows F5 & F8 key so I can step thru the code.

$
0
0
Hello,
I just bought a new Dell laptop. Comes with Windows10.
I can access the VBA code in my Excel 2007 workbook, but I have to click on 'DeBug', then Step thru for each step, when I should be able to just hit F8.
When I hit F8 some windows side bar appears - nothing happens in VBA.

Any help much appreciated!!!
Thanks.
Viewing all 49981 articles
Browse latest View live