Question and Answer

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

How to retrive text from DOS window(screen)

hi,i want to copy some text from an already opened DOS like window//

I also wana check(compare) the written text in DOS window with mine, like i wana check wht is written in 2/5 cursor position in dos or a dos like window(screen),can u plz suggest some code.

i already got the code to reach that already opened window, just want code for retriving text from DOS>

thanks..

a friend

display copied text by a msgbox in VB

Hello everybody , how are you.
I have some tasks , in which i am facing some problems.Plz help.

(1)I wish to display the copied text(clipboard) by a msg box,dunno what is the syntax for it in VB.
For example i have copied A and i want to display it by msgbox.

(2)Also i wish to compare or check this text with some another text.
For example i have copied text EDUCATION and i wish to compare it with the word SCHOOL and if the copied text is SCHOOL the VB programme will stop else it will process.Plz also guide where i should define the word SCHOOL in the VB programme.

How to copy a content of cell from one sheet to another sheet

Hi,

Please assist on how to copy a content of cell from one sheet to another sheet.

For e.g. in the attachment made the contents of Engineer wise Summary sheet N9 should be copied to the Engineer Score Card sheet C3

Regards,

Sathyananda KKR

 

Help with a Formula

Is there a formula or something that I can use to calculate yardage in a football game?

 

I would like to enter the yardline where the ball started and where the ball ended and it give me the total.

Example:  if the ball is on the 40 and goes to the other 40 it would tell me 20 yards.

 

Any Ideas?

Convertir dos rangos verticales en un solo rango vertical

Cordial saludo, agradezco a quien me puedo colaborar. La cuestión es la siguiente, ¿Què macro me puede ayudar para de dos rangos verticales (en dos columnas diferentes) me quede un solo rango vertical sin duplicados, (en otra columna diferente?

Por ejemplo:

A E
1105 1110
2105 1105
3115 4135
1524 6205

Deben quedar en la columna J, así:

J
1105
1110
1524
2105
3115
4135
6205

Operating a dos like window(screen) with the help of excel

Is this possible , to operate a dos like window(screen like dos) already opened at the desktop with the help of Excel.
The task is to write a predefined command on this window(screen) and then press enter automatically by excel.
Can we make an excel macro button which will automatically switch over to that dos like window and will automatically write predefined command on that screen and will press button enter.
Someone told me we can use SENDKEYS???dunno wats that.Wats is the code for excel-VB by which i can switch over to that already opened window(screen like DOS)
Can anyone guide, plz.

bill5174's picture

Copy a range of cells from worksheet in workbook a to worksheet in workbook b

I have worksheet (part a) in workbook(quote) with 30 rows of data which change with macro execution.

Checkboxes in VB Project/Excel

Hi,
I have a question, I am trying to add check boxes in a VB Project in Excel. I have them functioning only the data is showing up in random columns, not the designated ones I have created. Is there a code that will place the data in the correct column and only when the box is checked?

»

VBA excel to communicate with external SQL database

Hi there,

Curious if someone knows how to create

a VBA app that upon a click of a button can connect

to the database "MySQL", query it and return results.

Can this be done with ADO methods?

 

Sincerely,

 

Palu

Copy cells from one workbook to another with matching date

I am looking for help on this one.

I am trying to Copy several cells from one workbook to another workbook by matching date values.

Both workbooks already have the date in column B.

I have a total of two folders, C; Timesheets\JAsher Timesheet.xls in one folder and

C: Time Master\ Dev Time Master.xls in the other.

JAsher Timesheet.xls has a worksheet named "Timesheet" and data begins on row 9.

Column "A" is the weekday, Column "B" is the date, Column "C":"N" is data such as regular hours, sick hours, vacation hours and so on.

Pivot Table

How do I get the pivot table to now hide text in their summaries?

For example usually a pivot table looks like this (without subtotals)..

Customer State Product

A IL XXY
(blank) MI XXY
B AR XXY
C MA XXY
(blank) HI XXY
(blank) IN XXY

Instead I would like it to look like this (almost like a new summarize data that I can rework with..

Customer State Product

A IL XXY
A MI XXY
B AR XXY
C MA XXY

Vishesh's picture

Help! Lotus Mail from VBA (How to choose from which user id to send mail?)

One of my clients have two mail ids configured on his/her lotus notes? Every time a mail is sent it is sent using the default id. The other id is group id that he wants to use for sending mails from vba (without making it the default id). The code that we are using is this...I want to know how to set the sender mail id in Lotus Notes from vba...

Following is the stardardised code to send mail from Lotus...

 

Pivot Table with Chart

In this below code I am trying to get student wise report in separate worksheet through pivottable. Here I need chart to be inserted with the report.

How to do it please help me out?

 

Vishesh's picture

Extract Nth Word from a String

Here's how to Extract the Nth Word from a String
Function GetNthWord(strStringFrom As String, strSplitCharacter As String, intExtractWordNumber As Integer) As String
    On Error Resume Next
    GetNthWord = VBA.split(strStringFrom, strSplitCharacter)(intExtractWordNumber - 1)
    If Err.Number <> 0 Then
        GetNthWord = ""
    End If
    On Error GoTo 0
End Function
 
Sub ExecuteNthWord()
    MsgBox GetNthWord("Hi:Hello:Nick", ":", 2)
End Sub

Multiple Match, Multiple Arrays, IFs, and Counts

 

This is a schedule.

It comprises two parts: A listing with full job information, by job; and an overview of if or if not the engineers are being used, by engineer.

In the top part of the schedule, the engineer(s) assigned to the job is shown in column H (and I if two people are assigned).

The names in these columns are taken from the listing by engineer in the lower half of the schedule (to allow for a match).

'x' is placed in the appropriate week in the main schedule when this job is to take place.

 

get file attributes

Hi,

I am a starter with vba scripting. Thanks for developing such a gr8 blog and learning resource. Actually i wanted to design a macro which would get the name, date modified, and author of a contents of a folder on a server into an excel workbook.

Looking for assistance if any.

Again thanks for all the effort u hav put in.
 

Vishesh's picture

Range To Array

Paste the below code in a module and try running each of the 3 procedures. The procedure named Code2 gives an error, Code1 runs fine. To fix the error in Code2 some changes have been made and the procedure with the changes is called the FinalCode.

Can you conclude anything based on these codes ? Why Code2 gives error ? See the range assigned in the code.

Help needed on Optimizing search operation

Good Morning Everybody,

I am working with VBA and facing some problem as mentioned below. Could you please help me.

I have two files

File1 contains

Col A name of Employee

Col B

Col C

File 2 contains

Col A name of Employee

--------

Col X Reporting Manager Name

Col Y Project Name

 

Prevent Data entry once date has passed

I've come up with this code to prevent employees from retroactively editing data

The date cells are located at A3:A45

Yet I get a runtime 1004 error messege when trying to push the neet play button as I like to call it,

Ive marked the problematic spot with a strikethrough on here..but I sure do not know what is wrong with it.

 

I would really appreciate your assistance

Thank you!

Eyal

 

 

Help ME PLZ

i Have A file Which contains the names like this

Lokesh & Chitra
Adam & EVE
Paul & Nina

i want to remove the name and space before and after from "&" so my name look like this

Chitra
EVE
Nina

Plz Help Me.

Nested formula, repeat countif function using vlookup for an array of data

I am trying to create an excel formula in a database that will first find a loan officer code in one column (E), then on the row where a particular officer code was found, will look in column K for letter "J", if letter "J" is found the formula should count it and then continue to count up the J""'s for that particular loan officer code until it has searched the entire spreadsheet. Is that possible?

highest 15 values of previous 20 values

How do I sum the 15 highest values of the 20 previous values in a column. My column has many blanks that I don't want to consider and that I can't filter out. The previous 20 values don't always have the same sized data range. More details below.
-------------------------------------------------------------

I have a column with 8760 rows, one for each hour of the year.
sample data
Jan 1, 2010 Hour 1 42
Jan 1, 2010 Hour 2 (blank)
Jan 1, 2010 Hour 3 (blank)
etc.

How to get the event for application window resize

Hi, All.

I'm sorry for my English, i don't good in it, but I'l try to describe my question:

how could i resize the Userform (showmodal = false) when the Excel Application Window (Not WorkBook window) is resizing?

I want to see the Excel Application Window as MDI for all forms, creating in VBA.

Thanks, and feel free to contact me,

Anton

Refreshing Macro -Excel 2007

 Hi all,

 

I'm publishing/webpage a excel document and to have a macro to refresh this document on that specific page every 10-20 sec.

 

How can I do this?

 

 

how to arrange from max to min the results (from formula)

Hello,

i need some help regarding one subject.I want to arrange some results formula from max to min in another sheet.
i need some advice regarding to this subject (how to do it).
thank you and best regards,

Leon

Clear all the text box together

 I am using more then one text box in one form, i want to clear all these text boxes in one shot. currently i am doing it individually like "textbox1.value="",textbox2.value="" ...". Can any body tell me better way to do the same?

The Protect feature

Hi Can anyone help. I have put a protect on some cells on a spreadsheet and now whenever I go over to the left to column A or up to Roa A and I press the curesor to far to the left or too far up it shoots me of to the end or the bottom of the spreadsheet which is a bit disconcerting. Does anyone know of a way to stop it doing this? Dawn

Filter HideArrows and Subtotals

Hello everyone,

I want to do a couple things to this excel sheet. First I want the user only to be able to filter the Product column and the Description Column but not the rest of them. What is the query for this?

Help Please

I have a spreadsheet with some macros running, one of which is a user form which you input data (e.g. 5.6). This data is then transferred to sheet1 (I15). when this is done a formula in (J15) calculates weather (I15 e.g. 5.6) is within a range (C15 e.g. 5.4) and (E15 e.g. 5.8) and returns a value of "pass" or "fail" The formula I have written is =IF(AND(I15>=C15,I15<=E15),"pass","fail". My problem is that it keeps returning a "pass". Is there a format problem between the macro returning the value to the sheet ?

SPREADSHEET SHARING

Is there a way that two people can share writing priviledges at the same time in one 07 spreadsheet?  I have two people tracking inbound sales quotes in a single spreadsheet and would like both of them to be able to see each others entries.  Thanks for any help on this in advance!

Syndicate content