VBA Code To Configure Windows Power Management Settings

Jun 25, 2009

Is it possible to modify the windows power settings in excel vba. I have this example, but it doesn't do anything.

Sub testPOWERCFG()
CreateObject("WScript.Shell").Run "POWERCFG /CREATE Custom1", 0, False
CreateObject("WScript.Shell").Run "POWERCFG /CHANGE Custom1 /monitor-timeout-ac 15", 0, False
CreateObject("WScript.Shell").Run "POWERCFG /CHANGE Custom1 /monitor-timeout-dc 10", 0, False
CreateObject("WScript.Shell").Run "POWERCFG /SETACTIVE Custom1", 0, False
End Sub

I need some code to create and activate a scheme whereby everything is on and also some code to revert back to the default settings on the machine.

View 3 Replies


ADVERTISEMENT

Excel 2010 :: How To Get Power-query And Power-pivot

Jun 28, 2014

How to get Power-query and Power-pivot for Excel 2010?

View 9 Replies View Related

Works With US English Settings, Errors If Italian Settings

May 19, 2008

The following line of VBA code executes properly if machine settings are US English, but throws a "Run-time error '1004': Application-defined or object-defined error" ? ...

View 9 Replies View Related

Code To Edit Macro Security Settings

Apr 1, 2008

I need a code to change the Macro security settings of the computer where the file is opened to enable macros.

View 9 Replies View Related

Configure A Cell For Color Validation?

Jul 8, 2006

I want to configure a cell in Excel for color validation and I don't know how to do it. What I want is to configure a cell with a drop-down list of colors only, so the user can select from a set of predefined colors. I know how to create a data validation list by placing characters in a verticle list of cells, naming the grouping, then use data validation using a list to provide user selection. I also know how to conditionally format the cell based on the value chosen from the list, e.g. if 'R' is chosen from the list, the cell color changes to red, and the 'R' from the named list is placed in the cell. What I want to do is choose from a list of colors and only place the color in the cell.

I tried using non-printing ASCII characters in the list but Excel does not accept them. I tried to color the cells that comprise the drop down list, but the colors do not show up in the drop down list, nor when a member of the list is chosen. All I want to do is have the user select from a drop down list of colors only.

View 3 Replies View Related

Housekeeping For Code Windows

Aug 6, 2007

I have just messed up my explorer window and can't get it back the way it was.

I currently have three windows showing, Project, Properties and Code. Previously the windows were all linked so that if I widened the code window, the other two would become narrower. If I made the Project window taller, the Proerties window would automatically reduce in height.

My three windows are now totally independant of each other.

View 9 Replies View Related

Cmd Button Code To Display Video In Windows Media Player Object In Spreadsheet

Apr 22, 2009

I have a sample spreadsheet (uploaded to this thread) in which I have 10 command buttons named 'Video 1' to 'Video 10'. Next to these buttons is a Windows Media Player Object.
I require the code that upon clicking any of the video command buttons, the relevant video is opened and shown in the windows media object within the same sheet (sheet1).

I'm sure the code for each button will be the same apart from the cmd button reference number/name and the link to the file to be played.

If we assume all the videos are called as per their buttons i.e. Video 1.wmv, Video 2.wmv ... Video 10.wmv; and the location of these files is under 'C:Films', can someone post up some code for button 'Video 1' making it clear which variables to change for linking to the different files.

View 6 Replies View Related

Excel 2007 :: How To Adjust Protected View Settings But Protected View Tab Is Missing From Trust Centre Settings

Dec 12, 2013

Excel 2007 - need to adjust protected view settings but the protected view tab is missing from my Trust Centre settings - have the following tabs - trusted publisher / location, add-ins, activeX, macro, message bar, external content and privacy options. Document is a revenue authority download and without being able to adjust the protected view settings, can't input data.

View 3 Replies View Related

Management Of Payments

Dec 18, 2008

First, ignore the colored portions. This is how I kept track of what I had completed in the form as I created it. Clients attend class once a week and pay once a week for their classes. I'm taking this one step at a time. At the initial interview of a particular client we will determine the payment per session due, and we will enter this amount in the column labeled "payment per session. We also need to keep track of how many sessions they have paid for. So in short, I'm looking for the following:

When "amount paid" equals "payment per session" set "minimum payment due" to $0 and increase "classes paid" by +1

I figured out how to enter the payment and return the minimum payment due to "0" but how can I make the "classes paid" increase by 1 every time the minimum payment equals "0"?

View 5 Replies View Related

Time Management Tool

May 2, 2009

I have 143 macros, but I put 8 of them here b/c the post would not go through with all of them. I couldn't fit all of them on an attachment either b/c the file size was too big. However, I have this goal I have been working on for the last three months on the weekends and the last part.

I would like help with a macro that I can add onto the ones I have. I would like the macro to activate and cause a message box to appear when I open the excel doc. I would like also to be able to activate the message box and its associated macros after the document has been opened.

I would like the message box to have
- Message “The Current Time is (Macro puts current computer time here)”
- Question “How much time do you have?” then beneath this question
- Blank field labeled Hour to give answer
- Blank field labeled Minute to give answer

Depending on the current time on the computer as well as the hour and minute entered, a macro with a matching title from the list below will be selected that fits that criterion. For example, let’s say it is 5:30am and I entered 1 hr and 15 min in the empty fields of the message box. As a result the macro named “Sub Hour1Min15time530am” will be activated. Also due to the fact that the macros I have are in 15 min intervals the code would need to round to the nearest time, so if it was 5:33am when I ran the code the macro would default to 5:30am whereas if it was 5:39am when I ran the code the macro would default to 5:45am.

View 7 Replies View Related

Which Method Of Averaging For Management Reporting

Feb 22, 2010

Assuming the below performance report:

Day 1
Actual 1
Target 1
Achieve 1/1 = 100%

Day 2
Actual 1
Target 1
Achieve 1/1 = 100%

Day 3
Actual 9
Target 10
Achieve 9/10 = 90%

Which method do you use to report the Achievement for the 3 days?
1. Do you take the average of 100%,100%,90% to give 97%

OR

2. Do you sum Actual (Day1+Day2+Day3 = 11) / Target (Day1+Day2+Day3 =12) to give 92%

View 4 Replies View Related

Property Management Availability Calculator

May 7, 2008

I am working on a Property Management spreadsheet to track the availability of vacant units (and upcoming vacant units). I'm trying to write a formula to count the number of current units that are listed as vacant, so that I can ultimately report on the overall unit availability as of any given period (today, 15, 30, 60, 90-days out). All of the data in this spreadsheet is dynamic and each field can change at any time. There are also a lot of blank fields as well. I am using Excel 2003.

Here are the fields/data that I am using for my analysis:
Column A - (Reporting Period Dates): A2 = 5/20/08, A3 = 6/5/08, A4 = 6/20/08, etc.
Column B - (Unit Status: V=Vacant, O=Occupied): B2 = V, B3 = V, B4 = V, B5 = V, B6 = V, B7 = V, B8 = O, B9 = O, B10 = O, B11 = O, B12 = O, B13 = O
Column C - (M/O Date. These dates represent when the current resident will move out) - Cells C2:C13 contain dates for when each tenant will move out
Column D - (M/I Date. These dates represent when the future resident will move in) - Cells D2:D13 contain dates when the future tenant will move in

If my reporting period is 5/20/08 (cell A2), then I need to calculate how many Vacant units (B2:B13) I will have as of 5/20. The formula will need to count all of the current Vacant units (B2:B13), plus it will also have to take into account any Move Outs (C2:C13) during the reporting period. For example, let's say we have an Occupied unit that is scheduled to move out on 5/15/08. The cell will show this as "O" but the formula will need to determine if the M/O date is <= the Reporting Date of 5/20/08 (A2). If so, then Excel would count this unit as a Vacant for the period.

In addition to this, I also need the formula to look at upcoming Move IN dates (D2:D13). The formula will also have to determine if the MI date is <= the Reporting date (A2). If the MI date falls prior to the Reporting Date, then this unit should be considered as Occupied and should NOT be added to the total available units. NOTE - there are quite a few cells in column D that are blank and don't have MI dates. If there isn't a MI date, then the formula should assume that those units are Vacant if it is past the prior tenants MO date.
I'm assuming that Excel can handle multiple conditions like this, however, I am not smart enough to figure it out.

View 9 Replies View Related

DB Management - How To Add Data To All Clients In One Shot

Apr 4, 2013

My goal is to learn how to universally add specific codes to all clients in one shot.

Here's an example of the data I'm working with......

In column A - I currently have a list of 200 unique clients listed multiple times (1000 rows).
In column B - I have several different types of codes, but that are the same for each client.

Example:

A B
Client 1 Code A
Client 1 Code B
Client 1 Code C
Client 2 Code A
Client 2 Code B
Client 2 Code C

Etc. Etc. for 200 clients

So the question is: When adding a new code, How do I add a codes to all clients in one shot?

View 1 Replies View Related

Store Information For Session Management

Dec 18, 2006

I'm using Excel to connect to an Oracle database using an HTTP connection.

I'm new to VBA and was wondering if it is possible to use cookies to keep the above sessions active?

View 5 Replies View Related

Automate Work Force Management Sheet

Feb 24, 2013

I am required to fill up a sheet and provide to our Work force management team every week and it takes a lot of time from my day. I know this can be done easily with a code but I don't have enough experience with vb so can't write a good one myself

So here it goes -

I have a roster for my team (e.g. - sheet 2 "Roster") team members are required to work for 8 hours each day in their designated shift.

The codes in roster correspond to specific shift start time (e.g. - sheet 1 "codes")

Sheet - [URL]

I am required to fill up the sheet 3 "Staffing" each week for each half hour interval of a day that an advisor would be present for. So that means, I have to fill up 20 "P" for each member who is working on day from the time he would be starting his shift.

View 3 Replies View Related

Time Management Sheet - Transfer Raw Data Into Table

Oct 25, 2012

On a daily basis we have to manually fill in a time sheet, and I was trying to think of a way where I could just copy and paste it into excel and it would show me on another sheet the total amount of hours I have worked over the month. This gets slightly more difficult, as different clients have different campaigns, and you can work on any variety during the day (however, not all of them do).

Typical raw data looks like this:

Client
Hours
Campaign

Rubber gloves
4.1
SEO

[Code] ....

Therefore I would like to combine the data and then send it off to another report that looks like this:

Rubber gloves - SEO
Rubber Gloves - PR
Bottled Water

1/12/12
4.1
2.3
2.8

[Code] .......

This would allow me to keep a check of how many hours I am working on each campaign over the month, and ensure that I don't run over on time. I have the boxes prepared for the 2/12/12, 3/12/12, etc. where I paste the raw data, and let excel break it down and put it in the report automatically.

I have been entering the data manually so far and I'd quite like to avoid a pivot table or chart (but i am open to it).

View 3 Replies View Related

Component Life Cycle Management - How To Extract Correct Data

Apr 30, 2013

I am trying to create a life-cycle management sheet that is simple for the user but gives specific data.

The user would input "Date", "Machine type", "Component Set No.", and "Component". This would happen over a period of time and build up a picture of how often each component was lasting and it's average life in days.

I am fine from the user input side but am struggling to figure out how to extract ONLY the data I need to display in a graph.

For example: If I want to see the average no. of days "component X" is lasting before being replaced I've not been able to extract just that data. I have tried using a pivot chart but this won't do exactly what I'm after.

See the attached for a clear explanation : Component LifeCycle Example.xlsx

View 5 Replies View Related

Excel 2003 :: Templates For Personal Bank Account Management

Dec 10, 2013

I really need a comprehensive excel file which can manage my bank account id, savings, transactions, withdrawals, transfers etc etc. could be better if it can show any graphical interface with charts as well. I am willing to have a file so that i can manage more than one bank accounts. ( Excel 2003 is my version)

View 3 Replies View Related

Tan To The Power Of Minus 1

Dec 10, 2008

How can i produce "tan to -1 " in excel ?

View 9 Replies View Related

More Sheet Power

Jun 27, 2006

im building a fairly intricate workbook at the minute but it is starting to slow down significantly lately as ive added more fromula's and sheets. I was hoping to make it even bigger but it looks like i might be stoped in my tracks. I have a reasonaby powerful computer and excel 2003. Does anyone know a way i could increase the capacity of this one particular workbook as it will be used by many people to enter data daily.

View 3 Replies View Related

Vlookup (look Up Management Teir Information From Sheet1 Onto Main Sheet As Per The File Attached)

Jul 14, 2009

I'm having trouble to get VLOOKUP to work. Basically I need to look up Management Teir information from Sheet1 onto Main sheet as per the file attached. Both RecordID columns are Text so they should work right? But VLOOKUP returns #NA error.

View 4 Replies View Related

To Find The Power ( I.e. ^ N) When You Have Other Variables

Mar 12, 2009

To find the power ( i.e. ^ n) when you have other variables.

Mathematical Perspective as well as through EXCEL..

Ex: 5^n = 125

We know that 5^3 = 125,

Now if I have been given the value 5 and 125 , then how do i get the answer 3 ( i.e ^ n) value...

I need to solve a slightly complex issue and therefore need help for the above requirement as well as to get the "n" value..

View 14 Replies View Related

Nested IF Formula (If Value In Cell R5 >0 Then Get The Value In Cel X29 On Power 4)

Jan 12, 2010

I am trying to do a nested if formula but I can't get it to work.
The condition is: If value in cell R5 >0 then get the value in cel X29 on power 4.

=IF(R5>0,POWER(X29,4)

View 2 Replies View Related

Type Numbers To The Power Of Number?

Jul 14, 2002

how can I type numbers to the power of something Say 12 to the power of 3. I want the 3 to be smaller and up off the line is that possible

View 3 Replies View Related

Mathematics - Power Trend Lines?

Jan 23, 2014

I am trying to fit a cooling graph with a trendline and I have found the power line to fit the best, as well as corresponding with Newton's law of cooling. However, I am not savvy enough to discuss how similar or dissimilar the two equations are!

the resulting equations from two different curves are as follows:

y=4305 x^-0.87733

y=4025 x^-0.91004

both fits have an R^2 of 0.996.

I am analyzing two scenarios of cooling the same object with three variables, one intended (the extraction of energy using water flow in one case, and no extraction in the other) and the others not under my control: different starting temperatures and different ambient temperatures. I need to understand if these are generally the same curve, or how very different are they? is there any statistical way to represent their relationship?

View 5 Replies View Related

Copy Tables Into Power Point

Apr 25, 2008

I have a question about coping table from exel into ppt, is this posible or not,

PS: i just need to copy a specific range of cells ex. A1 g17 into a slide in pp.

View 9 Replies View Related

Copying Selections To Power Point With VBA

Feb 23, 2009

I am trying to write a routine (via two comboboxes) that will enable users to select a choice of charts from one of three possible worksheets and have the charts on the selected sheet copied to PowerPoint. My difficulties are these:

a. I cannot determine how to pass the selections to Excel (see b. as well)

b. In some instances my charts are actually groups of a chart and a picture. how I should reference these? They are obviously not ChartObjects: when I use the macro recorder all I get is a range.

View 9 Replies View Related

Combination Of Pairs, Power And String

Aug 8, 2006

I have a string of n pairs and want to check various combination of that string.
Example: Pairs 58 78 15
Since I know I have 3 pairs (but it can be 2 or 4), I know the number of combination I want to test, ie 2 power 3 = 8 combinations. How can I program a code creating the various strings, ie 587815, 587851, 588715, 588751, 857815, 857851, 858715, 858751 ?

This is what I have so far (not much):

Public unique_pair 'number of pairs provided by another macro
Public mystring 'provided by another macro
Sub make_guess()

Dim number_of_combination, i
number_of_combination = 0


number_of_combination = 2 ^ unique_pair
For k = 1 To number_of_combination

'how to generate the various string ????

Next k
End Sub

View 9 Replies View Related

Power Pivot Chart With Stacked Column

Jul 30, 2014

I have created a Power Pivot Chart with Stacked Column chart. Made one axis as Secondary Axis and the axis is Clustered Column, but it is overlapped with Stacked bars.

Is there any easy way to solve this issue, apart from creating 2 dummy columns and making it work.

View 3 Replies View Related

Using Power Query To Do Multiple Searches On Website?

Jul 10, 2014

I've been trying to get power query to search a list of parcel numbers on an assessor site: [URL]. The problem I'm getting, every time you put in a different parcel number, you get the same URL for the results. I want to extract just a few pieces of information for each parcel search, but I can't initiate a search through excel. I'm thinking the problem is in the Data source settings. How can just get it to show me the assessors page results for a single parcel search in excel?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved