Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Making code less column-specific


Hi Don

Yes , I see. This work perfectly and is a very useful application.

Thanks again for your considerable help.



Best Wishes


Colin




In article , Don Guillett
writes
And I was using it to show you the choices. Incorporated here with a choice.

Sub changeallnumbersChooseOperation()
Dim mc, lr As Long
Dim row1value, dowhat, x As String
mc = ActiveCell.Column
lr = Cells(Rows.Count, mc).End(xlUp).Row
If lr = 1 Then Exit Sub
row1value = Cells(1, mc)
Cells(1, mc) = InputBox("Vary Number By How Much?")
dowhat = InputBox("A to add, D to divide, M to multiply, S to subtract")
Select Case UCase(dowhat)
Case "A": x = xlAdd
Case "D": x = xlDivide
Case "M": x = xlMultiply
Case "S": x = xlSubtract
Case Else
MsgBox "Not a choice"
Exit Sub
End Select
Cells(1, mc).Copy
Range(Cells(2, mc), Cells(lr, mc)).PasteSpecial _
Paste:=xlPasteAll, Operation:=x
Application.CutCopyMode = False
Cells(1, mc) = row1value
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
How Can I Assign an Specific Code to every Product Gmata Excel Discussion (Misc queries) 5 December 31st 07 07:21 PM
Making labels out of specific entries in Excel Dawn Excel Worksheet Functions 1 November 6th 07 09:35 PM
making a new column based on data in an existing column newyorkjoy Excel Discussion (Misc queries) 4 August 2nd 07 02:42 AM
making code more efficient timmulla Excel Discussion (Misc queries) 3 January 23rd 07 02:16 PM
Making A Code natei6 Excel Worksheet Functions 4 February 23rd 06 08:04 AM


All times are GMT +1. The time now is 05:45 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"