Question and Answer

For Excel / VBA questions - You ask, Excel Experts will answer

Need help getting numbers in cell to match with numbers in another cell

Hi All

Please see attached files. I need kcode1 to end up looking like kcode2. Reason being is, there is just under 5500 different numbers in the first column spread over 275000 plus rows.

I hope somebody can help.

Ian

Macro that allows Excel Field Data to create new Word Docs

Hi All

I'm sure this is a basic Excel/VBA questions, but I need some help with our reporting system.

I have our students' test results in an Excel workbook. Our client requires a Word report for each student individually.

What I'm trying to achieve is to have a click event Macro on each worksheet that, when run, will create Word docs, from a template, for each student, and save them to a specific file; but the report is to only include data from specific cells.

The macro must also be able to find duplicate documents and give the options to create new or overwrite existing files.

Need help writing a function

Okay, so I have a list of data all formatted as time (example: 00:00:00:00) and what I need to do is find instances in the column list where the last two digits equal 00 or 01 and the second two digits are not divisible by 10.

So, an instance like 07:40:15:00.

Then, I need just those found instances were the last two digits (the 00 or 01) are changed to 02.

Then, there's a final step in all of this:

Automatic calculation of minimum or maximum value in a cell

Hi guys

I want a macro that can calculate automatically the minimum or the maximum value of a cell depending on other cell's data. I am explaining:

I have cells A1, A2, A3 and A4 containing data. In cell C1 I have a formula that depends on data of the cells I mentioned. The relevancy of that data and cell C1 is not direct (the data of A1 to A4 goes to other cells fist before C1)

New to VBA and not sure what the code I have is doing

I have gotten a project at work and I need to change this code up a little bit but I'm not sure exactly how it is working. It is somehow taking data from another excel and importing it in another excel file. If somebody could give me some info on hos this is working that would be greatly appreciated. The codes looks like this

'Sub ReadAirfoilReport()

'Private Sub CommandButton4_Click()
Dim Chrt As Chart
'Dim Dict As Object
Set Dict = CreateObject("Scripting.Dictionary")
'Number = "CBDUCU3179"

'mainpage = Workbooks("Auto-Find Dovetail Deviations").Name

Not solved problem in swedish forum

Hi

I´ve tried to find a solution to my problem in forums before without success. My english is not the best but i´ll try to explain my problem...pretty nice one :)

I have a table like example below with a lot of rows. I want to put in a sum (qty-column), lets say 35

NAME TEXT QTY ODDS
Adam Text1 23 1
Lisa Text2 12 2
Jack Text3 12 3
Karen Text4 14 1

VLOOKUP or something else?

Hi all,

I am unsure whether I should be using a VLOOKUP or maybe an IF function for what I would like to achieve...

On the "Register" sheet I have a register over 4 weeks with students names in Column A and data I need in Column B:J.

I then have the register with some overall figures towards the end.

Over the course of the year the number of students on the document will be in the 100's.

Excel Forum Help Please

Hi

I have a 4000+ row sheet.

I have 3 values in cells in a row so for example A1 9.5, A2 -4, A3 -11

I need to be able to work out which 2 of the 3 values are furthest from zero, so in the above example it would be A1 at 9.5 and A3 at -11

Once highlighted then need if possible to be able to rank those two values so A3 first and A1 second and be able to apply labels depending on which cell it came from so if it came from A3 it would need to be labelled D1

Reading multiple text files and saving as Xlsm with same name as text file

Could you please help me on this? I want to read 3000 text files by opening in excel file and save as .xlsm file with same text file name. I tried many times. Mainly how to save files with same name as text file.

Need Macro restructered please help

Sub mySearch()
For Each gCell In Range("G1", Range("G65536").End(xlUp))
If IsEmpty(Cells(gCell.Row, 8)) Then
For Each c In Range("Z1:AOO324597")
I = Application.Match(gCell.Value, Range(c, Cells(324597, c.Column)), 0)
If Not IsError(I) Then
Cells(gCell.Row, 8) = I
Exit For
End If
Next
If IsEmpty(Cells(gCell.Row, 8)) Then
Cells(gCell.Row, 8) = "#N/A"
End If
End If
Next
End Sub

take range for a formula from another file

Hello,

I'm trying to include a range from another file in a formula contained in my macro as below:

'----------------------------------
' Set formula to column "Reason Code 2"
'----------------------------------
LastRow = Range("A2").End(xlDown).Row

Range("K2").Select
ActiveCell.FormulaR1C1 = "=IF(COUNTIF('\\Ukchsbmsfsp002.one.ads.bms.com\shared02\European Capability Centre\P2P\Reports\Daily target\MACRO\[skratky.xlsx]Sheet1'!A$1:A$23,RC[-2]),RC[-2],""OTHER"")"
Range("K2:K" & LastRow).FillDown

How can I use the Reference/Translate in a macro?

Hi,
There are many functions that use google translate, but did anyone write a macro/function to use Microsoft built-in translate?
It is located in "Research" tab - Translate button.

BTW. I know about Google translate function mentioned elsewhere. But I want to use the built-in one.

Thanks in advance

Converting numbers to year/month/date/hour/sec time stamp

I have a long serial number that I need help converting to a full year, month, date, hour, & second time stamp. I've tried using the standard formatting but the seconds make the serial number to long for excel to convert. I've also used Text to Columns but there's no options for seconds on the setting. Can anyone help please? Below is an example:

20150528144343

Thank you,

Duc

Shell Function Problem

Could someone please help with problem running code below. It works when I specify only 1 filename in the Shell function but when I try a loop, whereby I want Shell to simply be a file opener of file type specified (ie .sim), the system loops endlessly; opening the .exe and presenting a dialogue box from opened executable program "file doesn't exist".

Background: I've many .sim files in a folder that I want to perform an execution using code inside loop below. Once the task for first opened .sim file is complete I want to loop through all remaining .sim files.

Sub Test1()

Move/append to other file/sheets macro

Hi If anyone please help.

I have two sheets

1. One is source and other is master.
2.Master sheet have 10 sheets and source have 7 sheets.
3.Source file with 7 sheets are updated monthly and need to be pasted to master sheets(same name 7 sheets on master ).
4. While pasting data from source to master, data on each sheet should be pasted without headers and in the end of the master sheet.(e.g master sheet have 10 rows then paste should be from a11)

I've uploaded the sample xcel files.

Consigliere's picture

formula help please

Hello
I would like help with a formula to find max value in a column and display that value
in all rows of a new column.
please see attached
Many Thanks
Ian

=IF(ISNUMBER(SEARCH( ---- Trying to search multiple options to return the same value

I'm trying to reclassify certain clients by the state they are located in. We want all IL, MO, AR, TN clients to be "Central" region clients.
Currently the formula I am using, which is working the way intended, is

=IF(ISNUMBER(SEARCH($M$2,B8)),"Central","No")

M2 is ", IL", but I want it to also include the other states listed above as other options. How can I also include ", MO" ", AR" ", TN" to this formula so that those states will also return the "Central" value using only one formula?

Excel Form to calculate V.A.T

Hi,

I am trying to figure out how to get the value of VAT when you type the amount into a textbox in an excel vba form.

its just a simple form that i have created to control the selling price of my stock over various selling platforms.

i am struggling with getting the VAT when you know the selling price, i just want to be able to deduct vat so i know how much vat is on the selling price.

this is what i had, but this adds value to the selling price and not deducting it, i dont want that. To deduct in excel you would use 83.33%.

If Product11.Value = "£" Then

{Newbie} How to create a bargraph that allows overlaping date data.

I suspect that the subject isnt clear as to what I am trying to create. The x axis would be the time range from 12am to 11:59 pm. The y axis (from top to bottom) would have the days in a month, from 1 to 31. The horizontal bar chart would graph the awake and sleep times of someone going from top to bottom. The issue is that these times can overlap if a person is awake late one night(pm) into the next day(am). How can I make the graph respond to the fact that the start of a new days bar is a continuation of the previous days bar?

Date Ranges transcribed to dates in a calendar view in Excel

Hello! I manage clinical trials and in the trials there are patients that are scheduled to return for visits within certain time frames. I have a spreadsheet that helps me calculate estimated time frames for the visits which works great. However, I would really like to see the dates in a calendar format as opposed to a list format (which is how they are currently listed). While I am fairly good with excel, I have not been able to create another sheet with a calendar that shows the dates broken down by patient.

jogrady33's picture

worksheet change with if criteria VBA!!!!!!!!!!

Hi,

How do I add VBA code to individually format a cell in a range of cells from k5:bb500 to track changes when users have amended or added a new cell entry.

Basically i have a list of dates in column k whereby it defines when I have locked down resource dates that have been requested. If a user tries to change or enter a new value in the range I need the code to work only if the date in column K in the same row is < Today()

How to compare and add a count - make summary

3 columns
Sheet 1
Appointment Date - Column D row 2 (data validated list)
Sale Made (Y/N - Data Validated list) - Column E row 2
Sheet 2
Summary - Column F row 2

How to add a formula in Summary Column F Row 2 such that

If date = 10/09/2015 (for ex:) and the value in colum E row 2 is Y then add 1 in Summary Column F row 2.

Help needed with IF nesting functions

I want to create a formula that would calculate like this...

C145 between $9,999.99 - 14,999.98 =$0
C145 between $14,999.99 - $19,999.98 =$25
C145 between $19,999.99 - $24,999.98 =$50
C145 between $24,999.99 - $29,999.98 =$75
C145 between $29,999.99 - $34,999.98 =$100
C145 between $34,999.99 - $39,999.98 =$125
C145 between $39,999.99 - $49,999.98 =$150
C145 between $49,999.99 - $74,999.98 =$175
C145 between $74,999.99 - $99,999.98 =$200
C145 between $99,999.99 - $99,999,999.98 =$250

PLEASE HELP!!!

Conditional formatting to highlight due dates only considering business days

Hi there,
I have a spreadsheet tracking documents that require review. Documents need to be reviewed within 7 business days of receipt. I would like to use conditional formatting to highlight the comments due date based on number of days from the current date. ie: green 7-6 days, yellow 5-4 days, orange 3-2 days, red 1 day, maroon for overdue.

I can apply the conditional formatting but I can't make it apply only to business days! Any help would be greatly appreciated! I have attached a sample of the spreadsheet format, with dates in the columns discussed above.

Cheers!
Emily

Help on understanding a formula an insurance administrator uses to calculate an annulized cash value

I need help to understand universal life calculations. The policy has an annualized cash value interest rate of 4%. My husband paid on this policy for over 27 years. He recently passed away. Lots of issues with the administrator of the policy including being evasive and not returning calls. It appears we did not receive all interest on the policy. I was informed..."the concept is to never pay interest on the policy" I asked for a printout of all payments as the annual statements show there is interest at 4%.

copy and pasting in a sorted excel file

If I had an excel file that contains names of all wedding guests, and I sorted for those that RSVP a yes to the wedding I call this excel file EF1. Then, separately, I have another excel file (EF2) that shows all the meal options of guests that RSVPed a yes to to the wedding. Then for whatever reasons, I wanted to copy & paste the meal options from EF2 to the "sorted to yes" EF1. However, since EF1 is sorted when I paste the information from EF2 to EF1, some of the information pasted over to EF1 will be pasted to the cells that are not showing (guests that RSVPed a no).

merging document with same column information

I have two excel files, and both which contain some customer IDs and other information. Let's say the Excel File 1 (EF1) contains all of my customer IDs and their respective purchasing amounts and other stuff. Then Excel File 2 (EF2) contains specific customer IDs that I want to work on. Right now, I would like to look up the specific purchase amounts from EF1 of customers identified in EF2 and then record those amounts in EF2.

VBA- Trying to combine; For each cell in range and Else

All I need is for the following code to work. Should be simple;

PHP Code:
Private Sub Worksheet_Calculate()

For Each cell In Range("W7:W17")
If cell.Value = "Payment Not Required" Then
ActiveSheet.CheckBoxes("Check Box 58").Visible = True
Else
ActiveSheet.CheckBoxes("Check Box 58").Visible = False
End If
Next
If cell.Value > 0 Then
ActiveSheet.CheckBoxes("Check Box 61").Visible = True
Else
ActiveSheet.CheckBoxes("Check Box 61").Visible = False
End If
End Sub

Automation Error... maybe cause by Textbox in Userform

Hi,

I have this problem with my vba coding, where I have this Automation Error when I execute my Userform.

After trying to figure the cause of the problem, it seem when I try to push some value in cells into the some textbox this Automation Error occurs when executing.

What is the problem? I use the same code format to push value in cells in another textbox but it working fine.

Even when I make a new textbox this problem didn't solve.

Compounding Commission Pay in the same cell - Do not care about % rate I need the $$ amount Compounding

I want a number in a cell to compound monthly but stay in the same cell from 01-01-2015 Through 12-31-2026

Here is my example:

Sales representative sold a product and is getting commission for it:
They are getting $15 commission from selling the product on 01-01-2015.
When 02-01-2015 rolls around, the cell updates with $30
When 03-01-2015 rolls around, the cell updates with $45
ETC.
ETC.
all the way to 12-31-2026

Cells Referenced (see attached image)

b3 has $15
b4 needs to show $30 on 02-01-2015 automatically(without Human interaction)

See attached.

Top right Yellow cell
Syndicate content