Question and Answer

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

Numbers

 Hey everyone,
 
I have a little question
In the first collum A:A i have a serie of random numbers ,
Now i wanna know how manny times a specific number appears after another specific number?
for exp. Lets say the numbers go from 1 to 40
and this is the serie 1,5,12,30,35,5,12
The answer on how manny times 12 hit after 5 is now Two times.
Does ennyone could help me on the function/Formule?
Greets Harmle55

Get Data using VBA

I am trying to create a data generation VBA, hope someone could help me as I find it highly complicated, but I need the same for my work assessment.
Please see the attached file.
Sheet1 contains the data to be copied.
Sheet2 contains the sample that I require.

I have also created a user form. Now the combinations I require are as follows.

Firstly all the data from Column A in sheet1 needs to be arranged vertically in sheet2 removing the duplicates
Then all the date from column D in sheet1 needs to be copied to sheet2 removing the duplicates.

Now

How to calculate PV01 when the Yield is negative

Hi, given a bond Yield one can calculate the basis point value (PV01) of a bond using the Excel PRICE formula via PV01 = PRICE(bond with Yield) - PRICE(bond with Yield+1bp). However when the Yield is negative this calculation fails. Do you have a workaround for this. Thanks.

How to do an automation for copy paste, added new row (macro)

Hello
I have attached file

I want to automated a some step (tab table Z)
Thus, for example, that in X 2012:

1) I want to copy D16:E16
2) added a new one blank below before the paste D17:E17
3) converted the 2011 to 2012 in cells D17: E17 (ctr+h function find 2011 replace the 2012)
and by analogy, 1) 2) 3) for Y

And just every year

In the point 3) conversion step, it can converts the 2011 to 2012 or 2010 to 2012 as comfortably.

Regards. Thank you in advance for your answer

How to get multiple conditional values from multiple excel columns in listbox

Greetings,
I am new in VBA and now having encounter with the problem.
I have excel sheet where data exist as below
Product, Balance
-------, --------
RJ-20, 6
Mask, 4
Rang, 3
Dsk, 7
Now I wanted to get values (product,balance) in vba list box whose balance < 6.
I will much appreciate if I could get reply.
Ben

VBA Code or Excel Function for Finding Duplicate rows with some same columns

Hi All

I want to ask for VBA Code or function in Excel for this condition:

I have 5 columns as below:
Table I
Brand Manufacturer Variant Packsize Value
A AAA Orange 3x400 500.000
B ABA Guava 5x150 150.000
E EEE Apple 2x250 200.000
C AAA Orange 6x500 200.000
D DAE Orange 7x200 250.000
A AAA Orange 3x400 350.000
E EEE Apple 2x250 200.000

Vishesh's picture

Multiline visible text in Cell

Please refer the attached Excel file.

Requirement - The pop up form should allow only that much text to be input that can be seen with max row height. Please note that cell width is not be altered.

Also see there is a code to adjust row height of the cell as per the text max upto 409 points.

Is there any other way to input multiline text in a cell in the same way as we enter in a Word document ?

HOW TO EXTRACT SOME ROWS FROM ANOTHER XLS FILE

Hi Everybody,

I have an xls file which I consider it as a database (called A), I would like
to extract some lines from the database A, for instance, in A I have data for
12 months, and I would like to extract all the line for March to another
file, and no change for the column,

Would it be possible to do by VBA? Could you help me to do that please?
Thanks a lot for your help
DAI

Excel Pictures - change filename

How do you determine the file name of a picture inserted into an Excel worksheet please?

I have a task which is to change the images in about 700 workbooks (this is a company logo)
Each time my client has a new client they have to manually insert the new logo on each sheet...

So I made a little c#/VBA app to do this - but I cannot determine the original file path the excel picture for the image.
So i have resorted to iterating the worksheet pictures collection and seeing if each picture is located in a like cell range.
(the name is somewhat random)

delete blank cells and produce a new summary table

Hi :)

I have a big spreadsheet (1st column "100 student Names" and 1st row "Dates" which are from 1/1/2010 till 31/1/2013! and each cell contains a "grade" (A, B, C,...).

For example John had an "A" in 1/1/2011 and a "B" in 13/1/2013 and Nick had a "C" in 15/6/2012 and "A" in 31/1/2013 and the rest of cells are blank cells.

At the moment the spreadsheet is very bothering because there are a lot of blank cells which I do not like to see them and I need to have a VBA code to provide a summary table for each person like below:

John 1/1/2011 13/1/2013
A B

Recognising certain part of text then giving corresponding answer

I a have with variable text in it and I would like to search that cell and recognise if two letters are at the end of a number text sequence. If it is I want to give a certain word as a result and if not give the default answer:

In the first cell might be 123-01TM
In the second cell I have a choice of two answers, for example "Tim" if "TM" is at the end or "John" if "TM is not present

123-01TM TIM
123-02 JOHN
123-03TM TIM
123-04 JOHN
123-05 JOHN
123-06TM TIM

Hope thats makes sense

Thanks

Vishesh's picture

Visible text in a cell

How can we get the visible text of a cell so as to be able to move the remaining hidden text in another cell ?
I am getting the text in the said cell from the user using a form interface and would also like to set the max text length of the textbox equal to what is allowed in a cell (max capacity of a cell). The textbox of course is multiline.

trigonometric question

how can calculate trigonometric question in excel ?
for example Pythagoras theorem and how can create tingle,circle, squire etc. in excel

Change The Colour Of Text In A Row Depending On The Date Entered In The Last Cell

Hey all, first time poster here!

I'm working on a project for work, which includes entering in expiry dates for certain pieces of information relating to work sites. I'd like to be able to enter in a formula which will change the colour of the text in the whole row depending on what date is entered for the expiry date in a single cell. Each entry uses four cells across a row, so say I was to enter it onto Row 3, it would take up Columns A-D. The entry in Column D is titled "Expiry Date", which has dates that I have entered into it manually, depending on the values given to me.

bisection vba code

i just tried my vba code for bisection method but it doesn't work. can someone help me by telling me where i went wrong.pppleeasse

Option Explicit
'declare global variables
Dim a As Double
Dim b As Double
Dim x As Double
Dim e As Double
Dim exp As Double
Sub getinputs()
'retrieve values from the spredsheet
e = Cells(4, 3)
a = Cells(5, 3)
b = Cells(6, 3)
x = (a + b) / 2
exp = Cells(8, 3)

End Sub
Sub getroot()
Dim fX As Double
Dim fA As Double
Dim fB As Double
Dim k As Integer
Dim n As Integer
n = Cells(9, 3)
Do Until k <= n
k = Cells(10, 3)

Any ideas? Excel 2010 won't maintain cell row heigth formatting when pasted from a previous page of the same workbook.

I created a simple 8 1/2" x 11" (landscape) "form" to log dieter's daily food consumption (on the weekly form). It tally's each column and row for daily and weekly caloric count. The original spreadsheet works fine but then I copied and pasted it to new sheets and the row height reverts back to the default setting on all rows except one. That one has my designed height.

Update Links and Break Links to PowerPoint 2007 from Excel 2007

I am new to the VBA language. This code works to open and save a power point 2007 presentation that is linked to Excel 2007 but not sure what the best approach is to update the link. If the presentation is set to automatic it will update the links. The problem is I don't want the saved new name to have the message pop up to update links.

Being new to VBA I don't know where the break link should be or the proper code to update links if the pptx presentation was changed to manual update.
Can anyone please help??
Thanks much

[code]
Sub Open_PowerPoint_Presentation()

mahaveersomani's picture

inventory valuation with FiFO method

i have 5 issues with the attached file

all the issues are mentioned in my attached file

any help will be much appreciated...

Thanks in advance...

Maximum Value

Hi guys,

What formulas should be employed to make the highlighted cells appear automatically when the figures in column C change,constantly?
(please view the attached file)

Many thanks!

Cheers

Excel coding reqd to import data file to master file

I am really new to this and I apologize if i am in the wrong section of the forum.

Basically i need help with something simple and very generic. I have two excel files i.e one master file and other data file and all i want to do is import excel data from datafile to masterfile.

please help coding to automate report.

Regards,Trimal

Seprate Data with the help of VBA code

Hi All,

I have one data file which i want to save as per the email provideed in one colomn.
i record a macro to seprate it.
but values in the filter are fixed. I want macro to pick values by itself.
please help ...........
Below is the code.
Sub sepration()

Application.Goto Reference:="R1C31"
Selection.AutoFilter
ActiveSheet.Range("$A$1:$AI$215699").AutoFilter Field:=31, Criteria1:= _
"123@abc.com"
Range("A1:AI215699").Select
Range("AE1").Activate
Selection.Copy
Workbooks.Add
ActiveSheet.Paste

ChDir "D:\Sushil\email"

FIFO Inventory VB Code in Excel 2007

Hi

I am a novice as far as VB is concerned. But I have tried to write some code. The sheet containing the Code and the required output are attached.

I need to find the age of my Inventory on a given date. The following steps need to be coded correctly.

1- all the transactions sales and purchases are on one sheet. - AgeReport
2- The data is first sorted by SecID and then by Settlement date.
3. VB code that does the following, given the Report date on the Age Report Sheet in Cell B1.
a - For each SecID add all purchases for Settlement Date< Report date

Excel Data Connections DSN resolution

I've noticed an Excel behaviour with data connections that I am looking for ways to sidestep. Say that you set up a new connection pointing to DSN1. You build a query, test it, love it and save it. Fine so far. Now, say that you then change the definition of DSN1 so that it points to a different server. I would have thought that Excel wouldn't care and would just build the ODBC connection when the query is executed. Wrong! I now see that Excel extracts vital info from the definition of DSN1, including the server address, when the data connection is set up.

Selected rows change to separate column

I'd like to change some rows, which exist in same column, to separate column.

e.g Original Data is as follows:
ColumnA ColumnB ColumnC
Monday
Cookie AS 2
Bread SMY 4
Pudding FMI 7
Friday
Cookie AS 2
Bread SMY 4
Pudding FMI 7

Required format is as follows:
ColumnA ColumnB ColumnC ColumnD

VBA CODE IF YOU CLICK VISUAL BASIC EDITOR

Dear Nick,

Good day.

I made a vba project with password protection for our company use but one of my officemates opened/viewed my vba codes in each sheets, modules, userform even I click locked project for viewing with password.
He is using hex editor to cracked and opened the password protected vba project.

In this connection, may I ask if there is an event vba code when you click the visual basic editor button/icon or Alt F11?

Custom Formula

Hi there! I want help!

I want to know how to insert a custom formula in excel that includes percentages and addition of them to the base value. This requirement must be common among a shopkeeper or for an on-line seller where he has the wholesale purchase price, the base selling price but wants to add a series of percentage values to make it his final selling price

Let me tell you an example:

Base selling price: 100
Fixed Carriage to charge from customer: 19%
Tax: 12.36%
Risk Cover Margin: 5%

So it's like: 100+19%+12.36%+5% = 140.39

Insert start and finish between data

Hi,

Is it possible using VBA to insert and before and after a set of data.

Example:

Beginning data

71723,121222010,EXAPLECOMPANY,2-13-2013,
71723,121222010,EXAPLECOMPANY,2-13-2013,
71721,121221142,EXAPLECOMPANY,2-13-2013,
71718,121234503,EXAPLECOMPANY,2-13-2013,
71718,121234503,EXAPLECOMPANY,2-13-2013,
71720,121238748,EXAPLECOMPANY2-13-2013,

After VBA


71723,121222010,EXAPLECOMPANY,2-13-2013,
71723,121222010,EXAPLECOMPANY,2-13-2013,


71721,121221142,EXAPLECOMPANY,2-13-2013,

Sum amount based on same reference id

Hi,

If I have a excel 2003 file with a few rows/columns as follows

1234B,AB900,1
1234B,AB900,1
1244A,AB901,1
1267B,AB906,2
1279B,AB915,1
1279B,AB915,3
1279B,AB915,1
1288A,AB922,2

Is it possible to create a new line below each group of id and enter the total of column C using VBA

example:

1234B,AB900,1
1234B,AB900,1
2
1244A,AB901,1
1
1267B,AB906,2
2
1279B,AB915,1
1279B,AB915,3
1279B,AB915,1
4
1288A,AB922,2
2

Thanks for any help,

David

Re-position data and sum quantity based on matching reference

Hi,

I'm using excel 2003 and using VBA I want to convert data from my original data below.

The first row is just to identify the columns below it.

REFR1,REFERENC2,COMPANYNAME01,CURNTDATE,QUANTITY,ITEMNUMBER,PRICE
71723,121222010,EXAPLECOMPANY,2-13-2013,1.0000,MPG TBS01 TB,65.9900
71723,121222010,EXAPLECOMPANY,2-13-2013,1.0000,MPG TBS01 CH,86.5800
71721,121221142,EXAPLECOMPANY,2-13-2013,1.0000,MPG PB01,75.9900
71718,121234503,EXAPLECOMPANY,2-13-2013,2.0000,MPLC001,146.9900
71718,121234503,EXAPLECOMPANY,2-13-2013,1.0000,MPMC001,120.9900

Whose got the brains to solve my problem

Look at my simple sheet and tell me how I can find the matching place where in this case the X is .
So how do I match the description " Toren connectie niet goed" with the column of the month FEB ??
Both need to be searched for ! So one var = description ,and the other var = month ( FEB in this case.)
Then the answer is placed in the corresponding cell ( X crossed)

I get stuck from any approach.

Syndicate content