Question and Answer

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

Calculate Differences Between Time w/ Variables?

Hi All,

I really would appreciate any sort of help anyone can give me. I will try to explain in detail as best as possible. I am keeping track of user time that an employee uses a program. The variables I am working with is Log In, Log Off, Reconnect, and Disconnect. I figured out how to calculate the difference in time from an easy Log In to a Log Off, but the situation gets a lot more complicated making it much more confusing. I have tried using pivot tables but does not do what I need.

select the first cell containing data after using autofilter

Hi Experts !
How do I select the first cell containing data (if any) after using autofilter ?
thanks

copy data from one cell to another

I need to copy data from one column to another, but in the range of cells I am going to, I want 4 spaces in between my numbers. So, my thought was to put all 30 numbers in a column, and then run a function really quick and have it paste the cells for me. I have worked with my for loop in another function, not to copy, but to only read, and using the same Idea there it works fine. This will copy if I type the range numbers in like this:

Range("A1").copy Range("B1")

I bet no one can answer this STRANGE question! Copy/pasting email account passwords from Excel shows wrong password, but its not

I am using Windows 7 and Excel 2010, I would say I am a 7-8 level of proficiency in Excel. I have a business degree and use Excel very often. I have tried this on 3 different computers. Here is my question:

Refering to te previous sheet - VBA

Hi i´m new on Excel VBA. On hard time i accomplished to modified/create/mix this routine for a button, but the only thing a could not make it work is when i create a new sheet (the code do that and allow you to give the new name of the sheet) the "calculus" that must be do it on the new sheet must be refenced on the last sheet. See the Code below, the XXXX´s should be the name of the previous sheet. So i ask it´s possible to do it? If yes how can i do it?

Sub Botão10_Clique()

Dim ActNm As String

Dim sWh As Long

sWh = ThisWorkbook.Sheets.Count

Ammending Excel Macros

I am currently upgrading our infrastructure which involves new equipment hosted in a different place. As part of the data move we have huge amounts of Excel spreadsheets which have entries in their macros pointing to a particular server. Does anyone know of any tools available whereby I can interrogate macro's remotely and ammend entries within the macros which point to a particular URL? The current version is office 2003 which has been updated to 2007 in the new environment.

Link function to Sub

I want to calculate distance between two latitude and longitude coordinate.
I have this coding, it can be run but nothing is happening. Can anyone tell me the problem of my coding?

Option Explicit

Private Const C_RADIUS_EARTH_KM As Double = 6371.1
Private Const C_PI As Double = 3.14159265358979

Function GreatCircleDistance(Latitude1 As Double, Longitude1 As Double, _
Latitude2 As Double, Longitude2 As Double) As Double

Dim Lat1 As Double
Dim Lat2 As Double
Dim long1 As Double
Dim long2 As Double
Dim X As Long
Dim Delta As Double

X = 24

If, Then Formula

I need help! I'm trying to create a formula in a 10 year spreadsheet that populates a cell with a "replacement cost" every 14 months. So in year 1, there would not be a "replacement cost" because only 12 months have passed but in years 2-7 there would be but in year 8 there wouldn't be and so forth. I don't know if you need a remainder type formula or an If, then formula or what? Does anyone know how to create something like this?

[Solved} Creating a new sheet -

Hi i´m new on excel, so have a doubt. i would like to creat some sort of diary so when a create a new sheet, automatically this will have same content of the old one, but some cells must be updated, like the date and the new page. It´s possible to create somenthing like that? If yes how can i do it?

Since now my regards.

ALNeto

Search, Copy & Paste macro.

Hello,
First of all, i will thank all who reads this question.

And such a good forum.
I have a question regarding a Macro in Excel 2007.

Basically i have spreadsheet which is a small database.

Sheet1 is a database. Sheet1 keeps all data
Sheet2 is a inputsheet or form.

What i need is, that when input is done, than it will search in Database and match it, copy the values to database.

Sheet2:
C E F
Name Input Age Input weight
16 John

Ex. i am going to fill age and weight in E16 and F16.

is it possible to use both XLS and XLSX types of file in my code.

i am using excel 2010, i have written a macro to get the XLSX types of files as a input to textbox 1 and its working,now how to get both XLSX and XLS,is it possible.

Use a custom function in any excel file

So I made some really cool functions for analysing data for my boss, but any time I open a new excel file I have to add a new module to that file, copy and paste my code in it so I can use my functions. Is there a way to make it so that I do not have to do this? I am adding the module to VBAProject (dataForMyBoss.xlsx). I have tried adding the module to the PERSONAL.XLSB, but then I can not access my functions. I am assuming for my functions to have global scope it needs to be in ther PERSONAL.XLSB, but I can not use them there.

using pre defined functions in your function

I want to use excels average function, but in a little bit of a different way, so I made a module with all required subs to clean up the incoming range. The first 4 lines in the function work fine. For some reason it will not let me use the built in average function, but I have used other functions in this module such as day() and char(). Help please.

Function adamMonthlyAverage(ByVal dataRange As String)

Dim beggining As String
Dim endding As String
beggining = getTopCell(dataRange)
endding = getBottomCell(dataRange)

Printing the same thing once with different dates.

This may just sound like I am being lazy but I have mulitple forms that get printed at the begining of the month. Each one has to have the date put in. In trying to save time and not having to switch the date after each form is printed. Is there a formula that will allow me to print once all 30 to 31 days at the with each date put in 1 day per page? Does that even exist or do just need to do it manualy.

VBA Help--Access--Compiler Error:Type Mismatch

Hello, I have been working on this project. I have 2000 tables in my access database and want to append all of them to one table. Please HELP!!

Private Sub Append()

Dim db As Database
Dim str As String
Dim newr As Recordset
Dim oldr As Recordset

Set db = currentdatabase
Set newr = db.OpenRecordset("Main")

For Each TableDef In db.TableDefs

str = TableDef.Name

If str <> "Main" Then
Set oldr = db.OpenRecordset(str)
Dim strSQL As String

Excel-getting the extreme values of a data group

Hi Emma

In continuation to the query-response on the subject, I have one more concern.
Please find the attached.

Function in D6:
=VLOOKUP(GETPIVOTDATA("Min of Sl. No.",$A$4,"Operator","Kumar"),Sheet1!A:B,2)
Its result in D6:
1234_0458.1019.tif
This function in column-D has the operator "Kumar".
When I drag down this function to further cells, the operator is not changing and so is the result.

Why isn't the operator not changing in the function? Do I need to edit the operator every time? Please advise.

Another point on which I need your advise is...

add code to a macro add row to paste into another sheet

I have wkbk which includes a master (summary) sheet which I've set up a macro in to take also copy each cell entry over into a corresponding cell within other worksheets. In other words, when I input a date (for tracking a maintenance log) into my 'master' worksheet, I have a separate worksheet for each individual machine to log maintenance performed at specific intervals (i.e. daily, weekly, etc.). So far I have my macro working to transfer dates entered into my 'master' worksheet onto the other worksheets to populate the corresponding cell - to keep from doing double the work.

Newbie Date function

hi all, i have to fill out date at a cell on a worksheet with 30 sheets. the first sheet at a cell is filled with a date, the second sheet should be filled with the day after. I should have a macro to do that.
the first sheet at the cell A(1,1) with 01.11.2012
the second sheet at the cell A(1,1) with 02.11.2012
and so on
thanks for helping

check every cell in a range

hi all,

here i have a little problem please help me out---
i have created a macro.
i have 2 button one for start time and another one is for end time ,
right now i can click on any button and insert the end or start time but i do not want to insert end time untill start time is not there

for more clarification u can check out below code please help me out--

Dim rng As Range
Dim cell As Variant
Set rng1 = Range("L5:L65536")
Set rng = Range("K5:K65536")
For Each cell In rng
If IsEmpty(cell) Then
rng.End(xlUp).Offset(1, 0).Select
MsgBox ("enter 1 value")
Else

Concurrent event analysis

In the attached Excel file, I have the raw data in the worksheet "Raw data". I want to perform an analysis to get the number of concurrent events during a particular hour of a day. The resulting table should look like the one in the 2nd worksheet "Final data". Is there any Excel Formula or VB macro I can use to automate the analysis? Thanks.

Index across multiple sheets - or a better way (please)

I have 20 sheets in one workbook all set-up identically that I'm using for source details and from it I need to identify basic information. I have set-up a 21st sheet to provide me with a min rate from within the other sheets which I'm getting - but now need to identify where that rate came from either from the sheet name or from cell a1 in each sheet. Can you advise best way to get this info?

excel help.jpg

How the copy stock chart from web (such as from finance yahoo) into excel using Excel VBA

I've try use the code by Vishesh to perform the job but it seems that's only work for jpb / tif etc. But for the stock chart as as below link, it seems not working, any suggestion?
http://chart.finance.yahoo.com/instrument/1.0/%5EHSI/chart;range=1d/imag...

Below is the original code from Vishesh:
Sub GetShapeFromWeb(strShpUrl As String, rngTarget As Range)
Dim shp As Shape

With rngTarget
With .Parent
.Pictures.Insert strShpUrl
Set shp = .Shapes(.Shapes.Count)
End With

Excel-getting the extreme values of a data group

Hi

I am sorry, I have to re-open this query.

Actually I have tried to reply to an earlier response for this query but as I am unable to attach the spread sheet there, sending this as a new topic again.
Please let me know how to attach a file in the reply window.

The idea of inserting a Pivot Table and there by getting Min & Max is good but this works for numeric fields only, I believe.

The format of document numbers in my spread sheet is like this:1234_0456.0789.tif and I should not change them in any manner.
They are arranged in increasing order.

Excel-Formatting Tab Name

Hi

Excel allows us to format the dates in a cell as shown:
10/23/2012
Tue 23-Oct ddd dd-mmm

Please let me know if there is any way to format the Tab Name as shown above other than renaming it.

Thanks & Regards
Kumar

question for if function

how i do that ?
i made a ledger then i want to do that, if total of dept accounts bigger than credit accounts, post End balance as a text and value automatically
thanks,

if statement: if Y, then concatenate three columns into one

I am in urgent need of help.
I have an excel with a lot of data that needs to copied into Word document.

Let's say there are four columns in my Excel. Three columns of data (A, B, C) and one column (D) with Y/N indicator. If D is Y, I need to concatenate data from A, B, and C columns and populate in E column. It sounds very basic, but I have not done this before and in urgent need of this.

Thank you in advance for your help.

vba workbook_sheetchange event for xlam thisworkbook.

Hi,

Is there any way to write "workbook_sheetchange" event for Addin xlam Modules or thisworkbook of xlam.

Appriciate if you can provide a solution.

Thanks,
Divakar.

using VLOOKUP with close files

I understand that Microsoft doesn't support using VLOOKUP with closed workbooks when the table array (second parameter) is dynamically built. I have tried indirect.ext but that doesn't work like VLOOKUP because it will only retrieve 1 row at a time and it is slow. I tried the PULL code but either I'm doing something wrong or the code I found doesn't work with Excel 2010 because Excel keeps crashing. What other options do I have? I am not a VB programmer.

Thanks
Sam

match header name and find blank cel and paste header name in remarks

hi,

i need to match Column 1 by the list of name in header, as it is not fixed header names every page ,so need to find by Selected name and need to search for blanks cell in row and paste the blanks header name in remarks row for each column till the end of page
need to put comma after each header name and remove last comma . if find single blank cell add ( is Not Available ),if more add ( are Not Available ) in remarks cell ends of words. NEED VB OR MACRO .
all in upper case .

NEED VB OR MACRO .

Service Point No
Source No. (11 Digit )
Mobile / Landline No

Match list of data of header name and High light in colour unmatched data (vb or macro )

HI,

IF HEADER NAME IN COLUMN 1 ANY WERE FIND ( METER MAKER ) NEED TO MATCH DATA IN ROW THE LIST AND MARK UNMATCHED DATE AND FILL IN YELLO COLOUR THE CELL.(vb or macro )

List of name

LT-LTD
LANDIS+GYR
ALSTOM
INDIAN METERS
ISKRA
TTL
BHEL
GENUS
RC-ENERGY
HAVELLS
REMCO
SEMS
SIMCO
ALSTHOM
ELYMER
SECURE
ACTARIS
SIEMENS
UE

Syndicate content