Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Need macro to add numbers in rows

Hi,

I hope someone can help.
I need a macro to do the following:

Range A1:A1000
Jump to next row which is not empty
Jump one row backwards
Write the number "1"

Jump to next row which is not empty
Jump one row backwards
Write the number "2"

and so on until selected ranged is completed

Then I need another macro that will be able to find and delete all of the
numbers entered.


Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Misinformation - see this instead

I hope someone can help.
I need a macro to do the following:

Range A1:A1000
Jump to next row which is empty
Jump one row forwards
Write the number "1"

Jump to next row which is empty
Jump one row forwards
Write the number "2"

and continue this way until selected ranged is completed

Then I need another macro that will be able to find and delete all of the
numbers entered.


Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Misinformation - see this instead


On 1-Nov-2013, isabelle wrote:

=IF(MOD(ROW(),2)=1,CEILING(ROW()/2,1),"")


---------------------------------------------------------------------------------

Hi,

Unfortunately, this seems not to be usable in my case.
Pulling down this formula also deletes existing data and this is not what I
want.

Therefore, I think the only way is to let a macro do the job.

Still hoping for a solution :-)

Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Misinformation - see this instead

Hi Claus Busch,


On 1-Nov-2013, Claus Busch wrote:

what should happen if the row below the empty row has any entry?

Answer: Overwrite


Why do you want to enter numbers if you then want to delete them?

Answer: I wan't the possibility to renumber from the beginning (A1) in case
a new row is inserted or if a row is deleted.
Perhaps this can be done another way?

Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Misinformation - see this instead

Hi,

I think I have not explained clearly, what I want the macro to do:

Here is an example of the spreadsheet.:


A B C D
1
2 1
3 text
4 text
5
6 2
7 text
8
9 3
10 text
11
12 4
13 text
14 text
15



The row before a number is always blank and should also be left blank after
the macro running.
Text may be on 2 or 3 rows after each other. This text must not be deleted.
The only thing I want to renew (overwrite) is the numbers
The numbers are consecutive (From 1 to ?)

Hope this will help to find a solution.

Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.com

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Misinformation - see this instead

Hi Claus,

Your proposal was fantastic.
It works to my full satisfaction. Thank you very much.

After this I realized, I do NOT need another macro to delete the numbers
again.
Once again Thank you.

Regards,
Kaj Pedersen

---
Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
http://www.avast.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
Convert numbers stored as text to numbers - Automatically - Macro ExceLearner New Users to Excel 2 December 12th 12 07:14 PM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
i need to add 01 to the end of 500 rows of numbers sammies3 Excel Discussion (Misc queries) 4 September 12th 07 05:20 PM
Look at numbers between 2 numbers and copy the complete rows to a worksheet. bartman1980 Excel Programming 2 August 15th 07 02:56 PM
Sorting high numbers from low numbers between two rows scotty New Users to Excel 7 February 12th 07 09:38 PM


All times are GMT +1. The time now is 11:59 AM.

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

About Us

"It's about Microsoft Excel"