Copy & paste :: MrExcel Message Board



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Copy & paste
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

averstraeten
Welcome to the Board


Joined: 25 Aug 2003
Posts: 2

Flag: Canada

Status: Offline

 Reply with quote  

Copy & paste

Hi there,

Here is my big problem.

I create a 3 lines result with a calculus. Let say line 10 to 12
What I want with a macro is when you push on the button, the 2 first line are copied and pasted on line 30 and 31.The third one is copied on line 40.
That works ok with a macro. The problem is when I try the second time the macro. I would like that the next result, always on line 10 to 12 is copied and pasted on line 32 and 33 AND at the same time, a line is inserted and line 12 is copied after line 40 which is now 43 becaus of lines inserted.
I hope I was clear enough.

Thanks for any suggestion.


Bonjour,

Voici mon problème: Dans l'onglet équipement, une fois le calcul de l'équipement effectué, j'appuie sur le bouton ajouter une pièce d'équipement ce qui a pour effet d'ajouter deux lignes dans le premier cadre plus bas, ligne 33-34 et une ligne pour la maintenance ligne 42. Cela fonctionne très bien pour le premier ajout. C'est à partir du second que ça ne fonctionne plus, au deuxième ajout la maintenance ne s'ajoute pas au bon endroit.

Des suggestions ???

Merci d'avance, Alain

Post Mon Aug 25, 2003 11:14 pm 
 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

Monkey
Board Master


Joined: 11 Feb 2003
Posts: 251
Location: Gouda, Zuid-Holland
Flag: Netherlands

Status: Offline

 Reply with quote  

hello averstraeten,


First welcome to the board!
I Think this is what you wanted. At least you can puzzle with this (Sorry don't know how to write it in france sometimes i can't even do it english.) Keep posting

Sub Monkey()
Rows("10:11").Copy
If Range("A30") = "" Then
Range("A30").PasteSpecial
Else
Range("A30").End(xlDown).Offset(1, 0).PasteSpecial
End If
Rows("12:12").Copy
If Range("A40") = "" Then
Range("A40").PasteSpecial
Else
If Range("A41") = "" Then
Range("A41").PasteSpecial
Else
Range("A40").End(xlDown).Offset(1, 0).PasteSpecial
End If
End If

End Sub



Greetings,


Monkey
_________________
Strive to Excel

Post Tue Aug 26, 2003 7:42 am 
 View user's profile Send private message

averstraeten
Welcome to the Board


Joined: 25 Aug 2003
Posts: 2

Flag: Canada

Status: Offline

 Reply with quote  

Re: Copy & paste

It is not working unfortunately.

I try to explain my problem again. Line 17-18 I got the component and his prices. Line 19 is the maintenance price.
When I click on a button associate with a macro, I copy the first 2 lines at line 34 and 35 and I copy line 19 at line 42.
The problem is comming when I want to add a new component. it is ok for line 34 and 35 because I insert always two new lines. I am not able tos add the line 19 next or before line 42 which is now 45.
Any idea ?




Microsoft Excel - Test.htm___Running: xl2002 XP : OS = Windows XP
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
=

C
D
E
F
G
H
16
An 1An 2
17
Cisco 269124 555,000,00 792,39 792,39
18
Frais d'installation 1 000,00
19
Gestion et MaintenanceCisco 2691 1 416,67 1 416,67
20
21
TOTAUX MENSUELS 2 209,06 2 209,06
22
23
24
Totaux par année1 000,00 0,00 26 508,68 26 508,68
25
26
Total pour 48mois 106 034,71
27
28
29
30
31
Mensuel contrat 48 mois
32
PrixA la réception An 1An 2
33
34
Cisco 2691245550,00 792,39 792,39
35
Frais d'installation 1 000,00
36
37
TOTAUX MENSUELS 1 000,00 0,00 792,39 792,39
38
39
40
41
42
Gestion et MaintenanceCisco 2691 1 416,67 1 416,67
43
44
TOTAUX MENSUELS 0,00 0,00 1 416,67 1 416,67
Equipements

[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

Post Tue Aug 26, 2003 6:23 pm 
 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.