Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default InputBox Code

Thanks to both of you for your help. It was an easy fix by changing long to
double.



"Toppers" wrote:

Dim Amt as Double. Declared as Long with input < 1 it will give a value 0...
hence no change to your data.

"Ronbo" wrote:

I am trying to create a routine that will update a table by a given user
input. What I have seems to execute but no change are made. Any ideas about
what I am doing wrong would be appreciated.

Option Explicit
Dim rng As Range
Dim lastrow As Long
Dim cell As Range
Dim Amt As Long

Sub GlobalChange()

Amt = InputBox("By What % (As Decimal)")
lastrow = Worksheets("planned sales").Cells(Rows.Count, "d").End(xlUp).Row
Set rng = Range("d8:o" & lastrow)
For Each cell In rng
cell.Value = Round(cell.Value * (1 + Amt), 2)
Next


End Sub

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
Using Date in InputBox for criteria in code SMac Excel Programming 6 March 24th 05 07:48 PM
InputBox code baehrjf Excel Programming 0 August 12th 04 11:47 PM
InputBox code baehrjf Excel Programming 0 August 12th 04 07:13 PM
InputBox code Mark Excel Programming 0 August 12th 04 08:25 AM
Excel Macro Code invoking InputBox. Andrew Thorne Excel Programming 0 July 30th 03 10:23 PM


All times are GMT +1. The time now is 02:54 PM.

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"