What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » excel

excel
Author: Message:
toddy
Veteran Member
*****

Avatar
kcus uoy

Posts: 2573
Reputation: 49
– / Male / Flag
Joined: Jun 2004
O.P. excel
whats the best way to do 'add 1', to a cell selected/highlighted? basically everytime i click(or paste if makes things easier) on any cell i want the new value to be 'old value+1', so that i don't keep having to look what number is already in there, and then increasing it manually
03-23-2009 07:25 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: excel
Use a VBA macro...

Visual Basic code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Target = Target + 1
End Sub



Obviously just add a few conditions if Target is column A for example and if Target <> "" :p

EDIT: A bit more in depth:

Visual Basic code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target <> "" And ActiveCell.Column = 1 And ActiveCell.Row < 50 Then
        Target = Target + 1
    End If
End Sub


ActiveCell.Column uses numbers to represent columns instead of letters so A = 1, B = 2 etc.

This post was edited on 03-23-2009 at 08:07 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
03-23-2009 08:01 PM
Profile PM Find Quote Report
toddy
Veteran Member
*****

Avatar
kcus uoy

Posts: 2573
Reputation: 49
– / Male / Flag
Joined: Jun 2004
O.P. RE: excel
knew i should have change my first post, want to be able to select multiple cells at once, have them all add 1.
03-23-2009 09:51 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: excel
Are all cells in the same column or row? It'd be easier if there was some sort of pattern
<Eljay> "Problems encountered: shit blew up" :zippy:
03-24-2009 01:00 AM
Profile PM Find Quote Report
toddy
Veteran Member
*****

Avatar
kcus uoy

Posts: 2573
Reputation: 49
– / Male / Flag
Joined: Jun 2004
O.P. RE: excel
quote:
Originally posted by Spunky
Are all cells in the same column or row? It'd be easier if there was some sort of pattern
no, quite random spread

well 8 colums, 18 rows, but could be any selection of the cells

edit:
altho could live with select the cells row by row if it makes it easier/possible

This post was edited on 03-24-2009 at 01:32 AM by toddy.
03-24-2009 01:25 AM
Profile PM Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: excel
It seams easier to make a hotkey,
Select the cells, press the hotkey en let the hotkey print Selection.Count to a specific cell...
03-24-2009 12:38 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On