Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please help, I've been working on this for days

Hello, I've been working on this since this past weekend and I can'
figure it out.

I basically want the user to be able to select one column that the
want, and multiply each number in that column by another number (t
increase it by a certain percentage) and then place those new value
into a new column that the user specifies. The column could b
different; it won't always be the same column, which is the problem.
Please help me

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Please help, I've been working on this for days

Hi Nikkih,

You can use a formula
=A1 * 1.15

you can type 1.15 into a cell and copy it (Ctrl+C)
then select the cells to be changed
Edit, Paste special, multiply

Suggest trying this on a copy of your worksheet first
to make sure you get the hang of it.

Frank Kabel must be asleep, or traveling from work to home,
I got in at least 3 replies here in his absence. <grin
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Nikkih " wrote in message ...
Hello, I've been working on this since this past weekend and I can't
figure it out.

I basically want the user to be able to select one column that they
want, and multiply each number in that column by another number (to
increase it by a certain percentage) and then place those new values
into a new column that the user specifies. The column could be
different; it won't always be the same column, which is the problem.
Please help me!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Please help, I've been working on this for days

Dim rng As Range
Dim c As Range
Dim myarray() As Double
Dim num As Integer
Const Timesnumber As Double = 100
On Error Resume Next
Application.DisplayAlerts = False
Set rng = Application.InputBox("Select a range"
&_ "with the mouse", Type:=8)
Application.DisplayAlerts = True
On Error GoTo 0
If rng Is Nothing Then
MsgBox "You Press cancel"
Exit Sub
End If
If Selection.Columns.Count < 1 Then
MsgBox "you must have one column selected"
Exit Sub
End If
If rng.Columns.Count < 1 Then
MsgBox "you selected more then one column in the
destination range"
Exit Sub
End If
On Error Resume Next
num = 1

For Each c In Selection
If num = 1 Then
ReDim myarray(1 To num)
Else
ReDim Preserve myarray(1 To num)
End If
nyarray(num) = Timesnumber * c.Value
num = num + 1
Next
num = 1
For Each c In rng
c.Value = myarray(num)
num = num + 1
Next num

part of this code comes from rons a few post down

-----Original Message-----
Hello, I've been working on this since this past weekend

and I can't
figure it out.

I basically want the user to be able to select one

column that they
want, and multiply each number in that column by another

number (to
increase it by a certain percentage) and then place

those new values
into a new column that the user specifies. The column

could be
different; it won't always be the same column, which is

the problem.
Please help me!


---
Message posted from http://www.ExcelForum.com/

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Please help, I've been working on this for days

thier was 2 errors in code pasted above

in the first for each change the nyrange to myrange
in the second for each get rid of the num after next

sorry typing to fast


-----Original Message-----
Hello, I've been working on this since this past weekend

and I can't
figure it out.

I basically want the user to be able to select one

column that they
want, and multiply each number in that column by another

number (to
increase it by a certain percentage) and then place

those new values
into a new column that the user specifies. The column

could be
different; it won't always be the same column, which is

the problem.
Please help me!


---
Message posted from http://www.ExcelForum.com/

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please help, I've been working on this for days

How do I put the new values into a different column? The column coul
be anywhere on the page (the user would select the column)
thank

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Please help, I've been working on this for days

Don't either of my suggestions fit work?

Both will work on constants or formulas.

If you use a macro, I'd work on a selection, and
you usually work on the value so formulas would be
wiped out. Some things to look for in a macro see
http://www.mvps.org/dmcritchie/excel/proper.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Nikkih " wrote in message ...
How do I put the new values into a different column? The column could
be anywhere on the page (the user would select the column)
thanks


---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Please help, I've been working on this for days

This is what I have so far
Dim firstRange As Range
Dim secRange As Range
Dim percentage As Integer
Dim numCols As Integer
On Error Resume Next

Set firstRange = Application.InputBox(Prompt:="Input", Title:="DAT
RANGE", Type:=8)
percentage = Application.InputBox("Enter a %")
Set secRange = Application.InputBox(Prompt:="Output", Title:="DAT
RANGE", Type:=8

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate working days but change working week SamB Excel Discussion (Misc queries) 1 September 1st 08 09:17 PM
Making weekend days working days - the system cuts the working tim Fluffy Excel Discussion (Misc queries) 1 May 30th 08 10:02 PM
How to calculation no. of days (only working days) between two dat Vivian Chan Excel Discussion (Misc queries) 1 July 26th 07 09:16 AM
5.5 working days Amy Excel Discussion (Misc queries) 0 March 22nd 07 03:59 AM
How to Add 5 working days Trying2Learn Excel Discussion (Misc queries) 1 June 20th 05 12:52 PM


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"