Question and Answer

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

BUDGETING

Dear Members

I have Excel sheet with following data ,which kind of formula is used for the table ,I want to use formula for auto fill quantity as per budget.plz help in this regard .File attached

Book W:Picture Chart Computer ScienceChart Budget
item price $.300 $300 $200 $200 $200 available
28,832
Quantity ?? 6,766

External signal to active VBA Macro in Excel

Hello guys!

I have looked in the forum, but didn't find any topic about this subject so I'm starting one.
Mr. andycr have helped me a lot in something I'm trying to develop in the Autorun Macro topic I opened, but even if the target is still the same, the question is other, so I'm starting another topic.

Well no more delays, get to the matter.

I'm now looking for a way to create an external signal to VBA programming, I mean for example, create a signal in C++ program to send a information to VBA, does anyone knows if it is possible?

Excel Problem VBA

Hello,

I have a very big problem with Excel and searching for a solution, so any piece of advice is greatly appreciated. From what you may read will know that I'm not a very good english speaker, but I will do my best ;)

I have 2 excel workbooks. First excel workbook is a xml feed where I have applied some formulas and transform it to fit my needs, the second workbook is refreshed at 500ms and populating by a third party software ( in this case BetAngel ). I would like to export a sheet from the first excel to the second one, and link it to do some testing.

Excel keeps using 25% CPU after XML import

Hi.

So I finnaly got a workaround for importing data from my Web Service to Excel.
This is probably a veeery bad way of doing it so if anyone know of a better way I am glad to hear it. (Didnt work to use the normal child method since the whole result from the XML comes in one big mash in a child node)

It is currently working, but after I have imported the data I see from the Task Manager that Excel keeps using 25% CPU. And it also sometimes lags and mini freezes in Excel.
If I delete the row that was juts imported it immediately goes down to 0% CPU use and the lagg/freezes are gone.

Find Multiple Instances of a Numeric Value and Return the Column Numbers where the Value is found

Hi All,

I am using Excel 2007 for Windows. I would like a flexible (single) formula based solution for the following:

My data is numeric, in a tabular format spanning many columns and rows - the number of rows will continue to increase. I have numeric labels in row 3 spanning the width of my table.
The data starts in column "G" row 4 and ends in column "BK". The cells within the table are
populated with a formula which returns either a numeric value or empty text ("") showing a blank cell.

How to get a grade in C3?

Create an if-elseif chain that displays the correct letter grade for the student in C3.

Students final percent 99% E Grade Scale
A >= .90
B >= .80
C >= .70
D >= .60
E less than 60
the code i wrote:

Sub ifElseif()
' declaring variable
Dim sngPercentage As Double
Dim strGrade As String
'assign variable
sngPercentage = Range("B3")
strGrade = Range("C3")
sngPercentage = ActiveSheet.Range("B3").Value
If sngPercentage >= 90 And sngPercentage <= 100 Then
strGrade = "A"
ElseIf sngPercentage >= 80 Then
strGrade = "B"

production managment in excel

Dear Members,

First I'm a new user on this forum, and I would like to say Hello to everyone.
Second I have a few questions regarding my attached excel table.

I work in a firm that produces car parts, and I reqularly recieve forecasts from our partners, which shows us how many parts they want on each daily shipments we send them, these forecasts are broken down to days and usually consist of 3 months.

How to extarct number of digit in date?

Hello Colleagues,
I have a graphic where there is this
=SERIES('DIA-6'!$B$3;;'DIA-6'!$DT$2:$DT$24;11), the column $B$3 has
25/10/2011 1:00:00, I need that the series only show 25/10/2011
Thank you for advanced.

VBA and combo box filtering

I have a number of user forms. Let's say 5. Stage 1,2,3,4 and 5. At stage 1 a serial number is entered into a text box. At stage 2 the serial number becomes available in a combo box. I need to select the serial number from the combo box and press submit. I need the serial number to now show in a combo box at stage 3, BUT, no longer show at stage 2. Once the serial number has been submitted at stage 2 it can't be selected again (unless re-booked in at stage 1).

code for date between two dates vba

Hello,
I need help to make my code work..It' s a little bit frustrating.
I want the Userform to atomatically fill the other fields when The date (d)
and Time(t) are filled. I need vba to make automatically calculations in two periodes:
- from 1st june til nov
- from nov til june
Thanks in advance for you help.

Yhe code lokks like this:

Private Sub CommandButton1_Click()

Dim d As Date, t As Date, startTime1 As Date, startTime2 As Date, startTime3 As Date, Op As String, Vgem As String
d = CDate(TextBox1.Text)
d = TextBox1.Value

calculations across sheets in excel 2010

I have created a excel spreadsheet for 25 years of weather data. There is one sheet for each year; each sheet labeled with the year and with the year also listed in A1. Months are in columns and records are nested withing months. All years (sheets) are formatted the same. I am able to summarize data using an expression like MIN('1989:2014'!G48) which returns a correct value, but I also want to know in which year (sheet) the value exists. Is there an expression that will retrieve this additional info?

INDEX / MATCH Table Values

Hi All,

I have a workbook with two sheets. Sheet 1 in my reference sheet (sheet with my table) and sheet 2 is my actual data_sheet. On my data_sheet I have a set of data similar to the file on dropbox

https://www.dropbox.com/s/tzsu9iegznbs9vb/INDEXMATCH_Smaple.xlsx

Getting names for corresponding numbers

Team...
I am sorry for the huge delay made in responding to your question.

Here we go...

We build a data base of party names & property history captured from scanned images.
After a complete cycle of data processing, the data base will be kept online so that the customers can search and find the information.

We came across documents showing multiple last names such as the sample I have shown in spread sheet. I have added another sample for your understanding. Plz have a look.

Vikas Verma's picture

Solution ---help needed on sorting data based on multiple colums

Hi Please try this...

Sub testing()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim rng As Range
Dim cel As Range
Dim sh As Worksheet
Dim rcount As Long, rocount As Long

Set sh = ThisWorkbook.Sheets(1)
rcount = sh.UsedRange.Rows.Count
Set rng = sh.Range("D1:H" & rcount)

k = 1
For Each cel In rng
If cel <> "" Then
cel.Copy Destination:=sh.Range("R" & k)
k = k + 1
End If
Next cel

sh.Range("r:r").RemoveDuplicates Columns:=1, Header:=xlNo
rocount = sh.Cells(Rows.Count, "R").End(xlUp).Row

help needed on sorting data based on multiple colums

can anyone please help me in solving the below problem using VBA code.

is it possible to group the rows based on Multiple columns using VBA Code ? i have data from A1 to K1050 ( Data may change) column D as Account, column G as tracer, column H as wirn ( reference ),
column G reference would be generally populated in either G or D or H, now i need to group the transactions based on reference ( column H or Column G or column D)

Vikas Verma's picture

Solution How to tranpose 2 column excel spreadsheet by column A group

Hi Dear,

Please try this...

=IFERROR(INDEX($A$2:$A$11,MATCH(0,COUNTIF($D$1:D1,$A$2:$A$11),0),1),"") with CTRL+SHIFT+ENTER

Thanks

Ans.JPG
Vikas Verma's picture

Solution for I want to Input Data in One sheet and move data in another sheet automatically.

Try this..

Sub testing()

Dim shcount As Long
Dim sh As Worksheet
Dim Rcount As Long

shcount = ThisWorkbook.Sheets.Count
Set sh = ThisWorkbook.Sheets(1)

For i = 2 To shcount

sh.Range("b1").AutoFilter field:=2, Criteria1:=Sheets(i).Name
Rcount = Sheets(i).Cells(Rows.Count, 1).End(xlUp).Row + 1
sh.Range("A1:f1").Copy Destination:=Sheets(i).Range("A1")
sh.Range(Range("A1").Offset(1), Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeLastCell)). _
Copy Destination:=Sheets(i).Range("A2")

Next i

Ans.JPG

Error while Range and IF statement. Please help

Hi,

I getting "error -13 type mismatch" in this line below from my code

"If Rng1.Value >= 0 And Rng2.Value <= 999999 Then"

Basically I want to calculate formula only if values are greater than 0 and less than 099999.

Any help would be appreciated.

Thanks,
Vik

'mycal() is function created by me to caluculate X.
Sub mycal()

Dim thecountX As Integer

Dim Rng1 As range, Rng2 As range
Set Rng1 = range("C1:C25")

Set Rng2 = range("B1:B25")

If Rng1.Value >= 0 And Rng2.Value <= 999999 Then

Date Box in Excel 2010

I have a date box on my worksheet in Excel 2010. I have it saved as a macros-enabled document. When I go to reopen it, the date box is big and looks to be in designmode. Why won't it save correctly. See attached screen shot

Date box wont save.jpg
Vikas Verma's picture

Solution for Need to copy a certain sheet to the amount of the value on InputBox

Hi Dear,

Please find attached..

Sub testing()

Dim i As Integer
Dim wkb As Workbook
Dim sh As Worksheet

Set wkb = ThisWorkbook
Set sh = wkb.Sheets("template")
i = VBA.InputBox("Enter a Number")
k = 1
For j = 1 To i

wkb.Sheets("template").Copy after:=Sheets(Sheets.Count)
Set nsh = ActiveSheet
nsh.Name = "New Sheet" & k
k = k + 1

Next j

MsgBox "Done", vbInformation

End Sub

Thanks & regards,

Vikas Verma's picture

Solution for Conditional Format Using Formula

Hi Please use below mentioned formulas

=OR($F$39="N/A",$F$39="Yes")
=AND($F$39="No",$F$38<=50000)
=AND($F$39="No",$F$38>50000)

Thanks

Conditional formating.JPG

Data Counting

Hi,
Apologies if this is listed elsewhere ...
I have a column that reads
Yes
Yes
No
No
Yes
No

I want to count how many times it says "Yes" or "No" before it changes
I have a huge spreadsheet to analyze and this would make it much quicker

Using Excel 2010 and 2013

Thanks

Carl

Vikas Verma's picture

Solution to Find and move the duplicate values in another sheet

Find and move the duplicate values in another sheet....

Before using the below mentioned code please use conditional formatting with =COUNTIF($A$1:A1,A1)>1 formula there after this code will work.

Hope it will help you...

Sub test()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim rng As Range
Dim cell As Range

Set rng = Application.InputBox("Select a range", Type:=8)
j = 1
For Each cell In rng

If cell.DisplayFormat.Interior.Color <> 16777215 Then

Vikas Verma's picture

Save report as PDF

****************Advance Filtering and save file as PDF**************************

Dim wkb As ThisWorkbook
Dim h As Variant
Dim RowCount As Integer
Dim Rng As Range
Dim Fso As FileSystemObject
Dim Fpath As String
Dim Fldr As String
Dim Workbk_name As String
Dim LoopCount As Integer
Dim filename As String

Sub Testing()

On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False

MsgBox "Select Destination Path", vbOKOnly + vbInformation
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
Fpath = .SelectedItems(1) & "\"
End With

Vikas Verma's picture

Make Hyperlink Index of a folder files

Hi to all,

Create a Hyperlink Index..

File Index.JPG
Vikas Verma's picture

How to reply of a query with attachment

Hi Experts,

can i attach a image or a file while replying on Excelexperts.com...if yes then please assist.

warm regards,

I want to copy a range of cells on a sheet to another sheet as a summary.

Ihave a spreadsheet, with on one sheet columns a5:k20
Column a name.
b: sometext

column c:k are numbers, and those cells have a conditional format.

I want to copy the cells a5;k20 to another summary sheet.

The vba code i found is copying ths but it dosn't take always the right conditional format with it.

Sub Copy_E1_Rekenen()
Dim SourceRange As Range, DestRange As Range
Dim DestSheet As Worksheet, Lr As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'fill in the Source Sheet and range

Hystogram in Excel

Hello, pls help!
I need to have each of the bars on the diagram to be broken down into two parts(cumulative bar).
I dont know how to do this!

111.JPG

Block cells for updating

I have a worksheet with figures and fumulas. I want to block the formula cells for updating. Calculated Figures on these cells shold be visible as we need them to see.
Also, it is better if the sheet is not password protected. How can i do this?

Help with Filters and FILTERXML(WEBSERVICE

I thought I had everything entered correctly to pull my data. However,some cells are getting a #VALUE! error and the filters seem to be partially out of order when I try to filter largest to smallest. I am not sure if the error is in my formulas, spreadsheet design or on the server I am pulling the data from. I had to remove some data to make the file small enough to attach. This was a 2+ meg file. Hopefully you can still see where the errors are. Any help would be appreciated.

Syndicate content