Question and Answer

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

force msgbox in WSH(.vbe) to be on foreground

hello all,can any tell me ,how to force a msgbox made in windowsscripthost file(notepad .vbe) to be foreground always.

Regards

Ruth

Haha ,the moment i uploaded this question, googled it again and found the solution.

MsgBox "Hello", vbOKOnly + 4096, ""

Thank you all.

Regards
Ruth

Checkbox help

Hello,
I am having such a problem.
I want to make few checkboxes in which, when a certain combination is done to pop up a website.
For example :
having 5 checkboxes:
checkboxe1
checkboxe2
checkboxe3
checkboxe4
checkboxe5

assuming that checkbox 1 and checkbox 4 is clicked , then hyperlink to the .... website:
assuming that checkbox 2 and checkbox 3 and checkbox 5 is clicked , then hyperlink to the .... website

I think that the VB code should be something like this:
"If checkbox1 and checkbox4 = true, then www.xyxyxy.com/sakjdahlsjk.html , else..."

Searching for data in another sheet that match the conditions

For example i take first line name:cristine...years:3.....place:A. I must insert a function that looks in sheet 2 for the same parameters cristine 3 A, and count how many they are and put the count number in the count column. In this sample the result is 2:count=2. Next for michael 3 A :count=1

Any help would be greatly appreciated.
Thank you.

Regards,
Michael

Templates - not working

Hi there,
I have 2 PC's.
I have saved a template (name = Ref) as Macro-enabled Template.
On the first PC, it will open the template as Ref1, and I have it set to default save as Macro-enabled Workbook - All perfect.

On the Second PC, the exact same Excel setup (as far as I can see), it will open the Template as Ref (which allows the user to overwrite the template , and it ignores the Save as option setup in File, options, Save...)

Has anyone any ideas ?

I am stuck.
Thanks
Monica

Find text inside cells and sum their data

Hi,

I need to sum process time in every row the process name appears. In some cells multiple process names appear. I used SUMPRODUCT formula, but it did not find the text in cells that contain multiple product names.

Process total time

Process A 91
Process B 32

formula in cell "91" is:
=SUMPRODUCT((B18:B23=A2)*(C18:C23))

B18:23 C18:C23
Process Time
Process A 60
Process A, Process B, Process C 50

Excel-getting the extreme values of a data group

Help me out in getting the beginning value and ending value for a given data set from a spread sheet containing multiple data sets.

I have Document numbers in column-A and Operators in Column-B.
I have allotted x no. of documents to each Operator.
Now each operator has unique range of documents to work with.
Please let me know if there is any way to get the beginning Document number and ending Document number (Document range)of each Operator.

Find the uploaded attachment with this scenario.

Thanks & Regards
Kumar

macro to auto email multiple files

Can someone please help me with my problem below:

I have folder where about 150 files are saved each week and I have to manually pick these files from folder and email them to list of people.

Can this be automated with help of a macro that can help me select the folder I want and email all the files (including the sub folder) which meets the criteria and email them to respect peoples? The file format which has the list of email and file name is attached.

Cell C1 will contain the location where file is saved.

Hyperlink List to Worksheets

Hi All,

I need a Macro that will set hyperlinks to a list of Names. Please see attachment. My list goes upto 500 Names so need a quicker way of doing this.
Thanking you in advance.

Walter

Run time error '6' : Overflow

Hello, I when trying to run this macro:

Sub ROICalculator()

Dim Iterations As Long
Dim i As Long
Dim ii As Long
Dim iii As Long
Dim N As Long
Dim ObROI As Double
Dim eROInum As Double
Dim eROIden As Double
Dim eROI As Double
Dim x As Double
Dim y As Double
Dim z As Double
Dim PY1 As Double
Dim PY2 As Double
Dim PY3 As Double
Dim PY4 As Double
Dim PY5 As Double
Dim PY6 As Double
Dim PY7 As Double
Dim PY8 As Double
Dim PY9 As Double
Dim PYmin As Double
Dim P1 As Double

need to develop a macro that can copy data to another sheet, perform calculations

Hi,
I am totally new to Macros. I have a worksheet named "Raw File" which is sent to me every 2 weeks. The column position and their headings remain the same, but the number of rows changes. It contains historical and current month information.

import from one table to another

I have an Excel book 1 with 1000 items (row), it contains column A: item#, column B: manufacture, and column C: prices. Another Excel book 2 contains 500 items, this table has column A: item# (some are in book 1, some are not), column B: description

I created a new description column D in book 1, how do I import the description from book 2 to book 1, and have them auto match import to the correct item number without affecting book 1 items that are not on book 2? Also to let me know which items from book 2 that is not in book 1.

Run time error 1004 Applicatin-defined or object-defined error (Copy from src to dest

Hi Guys,
I am new to Excel VBA. I have got a situation where i need your help.
I have a source file and a destination file. Basically what i have to do is copy some cols from source file to destination file.
Say for example if i have 10 cols in Source file and 20 cols in destination file. I have to copy those 10 cols and paste
them across the destination file where the cols match. the cols are in fixed order so i do not want to search a string to find the corresponding col in the
destination file as i know they are fixed. i want to just match the cols. say A to B or C to C etc..

Need a macro to match and copy

Hi.
Currently, I have two workbooks and I need to copy data from one workbook to another using macro. First of all, I need to match data from 2 columns before copying the data from workbook2 to workbook1. Attached is a sample of the workbook. Please help.

Need a correct formula

Source:

ID Entity Name Trade Date Side
88k BC 66.00 18-Aug-09 S
1391 BED 89.00 18-Aug-09 P
74890 BED 74.00 18-Aug-09 P
74891 BED ABCD0036 18-Aug-09 S
74892 BED ADFGH0004 18-Aug-09 S
74893 BED XFGT0057 18-Aug-09 P
74894 BED CVBFGR0058 18-Aug-09 P
74895 BED VVBRTG0041 19-Aug-09 P
74896 BED FGFGFHC0 19-Aug-09 P
74897 BED GHGHTGH0183 19-Aug-09 P

Target:

ID Entity Name Trade Date Side
88k BC 66.11 18-Aug-09 S
74894 BED CVBFGR0058 18-Aug-09 P
74897 BED GHGHTGH0183 19-Aug-09 P

Copy list of Names to Worksheets

Hi All,

Could some-one assist me with a Macro that will copy the Names from a list in Sheet1 to the worksheets in a workbook. It should start with the First name in the list and copy this to a cell in the First worksheet, then the second name in the list to the second worksheet. Then fill the name down. Also to rename the sheets, to the names in the list. Hope this is possible. I have attached an example spreadsheet.Thanking you in advance.

Walter

Filename will not display on an Excel Template

Hi,
We have a template with a cell - =cell(filename).
If we save the template as XLT, the filename is blank.
save as XLTM - the filename is displayed correctly.

then the XLTM displays the filename on some PC's, but not all.

Anyone have any ideas ?
The templates do not have macros, so I would like to save them as .XLT

Thanks for any help
Monica

Automate a keying in Job

Hi,
We need to automate a number of tasks that are manually keyed daily.

We have a spreadsheet with columns headed Date, Total, UK, USA, Italy, France/ etc (a total of 15 countries).

Formula to Match 2 Conditions [Days360}

Hi All

I need help with a Formula that would match the contents of a cell in column D with cell content in Column C. with a 2nd condition been the name of the tool. These condition being satisfied, the formula will perform a Days360 on the adjacent cells.
I have attached an example spreadsheet [the data I intend on importing will have 100's of rows, need to see if this will work first.] and highlighted in yellow the type of match up. Thanking you in advance.

Wally

Delete all even Numbered Wrkshts

Hi All

Need help. I have a workbook with worksheet that are named with sequential numbers. i.e worksheet names 1,2,3,4,5,6,7,8,...... I would like a macro that deletes all the
worksheets with names that are even numbers.

Thanking you in advance

Select Successive Rows

Hi All

I need a Macro that will select every tenth row in a worksheet, beginning with the 5th Row, so the selected Rows should be 5,15,25,35,45,55...........

Thanks in advance

Walter

Need Help Big Time

I am running Excel 2002 and i have a Macro that is giving me trouble. Or precisely one line of the Macro. Set olAppItem = olApp.CreateItem(olAppointmentItem) ' creates a new appointment

Below i have the whole entire code. But the line above keeps giving me a and Error stating " Runtime error 287 application-defined or object-defined error".

I have also attached a copy of the file i am using. Can someone please assist?

Option Explicit

' requires a reference to the Microsoft Outlook x.0 Object Library
Sub RegisterAppointmentList()

Formula or macro

Hi All,

Hope some-one can help. I need a formula or macro that will convert a number which lies with a a range into another number [in order to normalise my data]

Example:
Between 0.01 and 0.99 change to 1
Between 1 and 2 change to 2
Between 2.05 and 4 change to 3
Between 4.05 and 6 change to 4
Between 6.05 and 10 change to 5
Greater than 10 change to 6

The actual "cell range" of the data varies. and all the numbers have 2 decimal places. Hope I have given enough info.

Regards
Walter

How to still scroll wheel when run vba ??

Hi,
This site is very good i found about exel vba.
I begin learn vba. I have one code vba. Now i want still scroll wheel when run vba.
How to do it ?
Thanks you very much.

IF OR FORMULA in VBA

Hi,

I have recorded a macro in excel
There are two sheets named "Unique DATA" and "DATA"

below formula was recorded in sheet Unique DATA C2 and draged till c10000
=(IF(OR(DATA!P7="SUB",DATA!P7="SUB1"),DATA!B7,""))

VBA script is as follow :

heets("Unique DATA").Select
Range("C1").Select
ActiveCell.FormulaR1C1 = "SUB"
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(DATA!R[5]C[13]=""SUB"",DATA!R[5]C[13]=""SUB1""),DATA!R[5]C[-1],"""")"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C10000"), Type:=xlFillDefault

Numbers convert into words

Dear Sir, I want know how to converts numbers to words in xls files?

Macro to import entire text file into single cell

2 -- Text File2 -- Text File2 ContentHi

I want to run a macro to Import Entire Text File in Single Cell

I have some Text Files in a Directory
Eg: C:\Records\

Each Sub Folder will have 1 Text File

Eg: C:\Records\Folder1\Text File1.txt
C:\Records\Folder2\Text File2.txt
C:\Records\Folder3\Text File3.txt

I want to import Each Text File into One Single Cell in a sheet

Like
Row -- Column A -- Column B
1 -- Text File1 -- Text File1 Content
2 -- Text File2 -- Text File2 Content
3 -- Text File3 -- Text File3 Content
4

Using functions to search cells in one sheet and paste in another.

Hi,

I have two new files...both files have two columns of certainty--Columns C and I. I want to fill Columns A and B in GlobalProject2, with data from GlobalProject. Basically I've been using If/index/Match in hopes of reading files and columns, and then inputting a rep's name into column A in GlobalProject2. It hasn't worked.

I need to Sheets.Add a single sheet of a template containing two sheets

Hi,

I have a template which also contains a revision log sheet, which I don't need to import.
The path to the template is

Path = "G:\Stuff\t3.xlt"

The code to import the template is

Set Sheet = Sheets.Add(, , , Path)

This code imports both sheets (and gives a strange message I can't figure).

The two sheets in the template are titled "Sheet1" and "Revision log".

I tried using the

Path = "G:\Stuff\[t3.xlt]Sheet1"

as I thought this would select the specified sheet.

Any help is appreciated.

Simple time card spreadsheet??

Should plugging in the formulas to this (see attached) spreadsheet be relatively simple? My friend tried to help me and I haven't figured out how close she came. I know that she made modifications I didn't ask her to make,.... she meant well. Eastern Effects is the original and mac212 is the modified with formulas plugged in.

Syndicate content