PDA

View Full Version : How to paste in selected rows of the selected column



fiza
04-04-2010, 10:28 AM
Hi Anyone,

I have a number format as R1234 that I want to paste starting from the column A10 to A1048576 of my worksheet. I would be pleased if anyone could help me to do this.

Cheers
Fiza

mdmackillop
04-04-2010, 11:41 AM
Is this what you're after?
Range("A10:A1048576").NumberFormat = "R0000"

fiza
04-04-2010, 11:47 AM
where do I have to paste the your code

mdmackillop
04-04-2010, 11:56 AM
Add it in a sub in a standard module

fiza
04-04-2010, 11:59 AM
I did use it in the following manner. but aint working

Sub Paste()
Range("A10:A1048576").NumberFormat = "R0000"
End Sub

lucas
04-04-2010, 12:05 PM
You're not real clear on what you're trying to do but Malcolms code works for me.

I had to shorten the number of cells it worked on because I have v2003 but if you click the button on the attachment it will change the number 2222 to R2222

Additionally, any 4 digit number you type into the range affected will be formatted with an R in front of them.

Edit: Attachment added.

mdmackillop
04-04-2010, 12:05 PM
It works for me (as I understand it), although I wouldn't use Paste as a Sub name. Can you clarify what you are trying to achieve?

fiza
04-04-2010, 12:14 PM
Guys cool down. What I want is really very simple. It goes like this.

What I want is that to past a number that is in the format R0001 into the rows of the column starting from A10 to A1048576.

I want a shortcut or an easy way to do this.
The only way that I know to do is highlighting the column starting from the row A10 and dragging the highlighting to the last row of the sheet. I guess this is a difficult way.

So I need a short cut to do this.

I hope I have made my question clear

Ago
04-04-2010, 12:17 PM
Fill down? Is that what you are looking for?
I really dont get it.

fiza
04-04-2010, 12:19 PM
yeah just to paste the number in the column A starting form the row A10 and ending to A1048576

Ago
04-04-2010, 12:22 PM
So is it always going to do fill down from A10 to A1048576?
No changes?

fiza
04-04-2010, 12:23 PM
yeah I only want to paste the number format in my sheet. when I know how to paste the code I can handle rest. I just want to know how to do that dear

lucas
04-04-2010, 12:26 PM
fiza, I have to say, I find your attitude towards those trying to help you to be a little condescending.

Please try to keep it friendly while here.

fiza
04-04-2010, 12:35 PM
lucas, I feel very sad to hear such a thing from you. I believe that's a total misunderstanding of me.

I have always respected those who help me. And I have never tried to be superior than any human who helps me. This is the first time in my whole life somebody has said such a thing to me. In my life wherever I have been I have always tried got the love and affection of the surrounding.

By the way, are you referreing to my signature? or are you wanting me to leave this forum.

I'm really shocked to hear such a thing from a forum administrator.

If you feel that I'm "a little condescending" I dont want to be a little condescending.

lucas
04-04-2010, 12:38 PM
Nothing to do with your signature and I may have taken what you considered joking in the wrong way. It just didn't come across as funny to me.

I hope you are just kidding around and just asking you to keep it friendly. That's all.

fiza
04-04-2010, 08:45 PM
I wasn't joking. Because I don't regard this forum as a joke. Instead I take it as a professional thing.

I do really appreciate all of your members work. That does provide a change in others life.

I had subscribed to many forums, but never did come across a forum where one of the administrators had pop up with an annoying & shocking answer or suggestion on me.

Anyways, lets leave the subject & be a bit more professional.

I wish all of you members success in your work & happiness in your life.

By the way still I haven't got the answer to my question; If I may ask.

mdmackillop
04-05-2010, 01:19 AM
If this is not your answer, please me more specific regarding your question.
Sub Paste()
ActiveCell.Copy Range("A10:A1048576")
End Sub

fiza
04-05-2010, 02:46 AM
Thanks mdmackillop. That was the code I was searching for.

mdmackillop
04-05-2010, 03:22 AM
For simple tasks, try recording a macro which will give you code such as

Sub Macro1()
Selection.Copy
Range("A10:A25").Select
ActiveSheet.Paste
End Sub


You can easily substitute your own values and, with practice, tidy it up to the essential elements.

fiza
04-05-2010, 04:56 AM
Thanks for the help. And I take your advice.