Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert cell anywhere

I am trying to insert some cells that I have formatted into a spreadsheet at
a point where entries finish. This could be anywhere on the sheet. So far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Insert cell anywhere

I am really not the expert here, but I wonder if you did what I always used
to do. That was to first select, via the VBA code, whatever I wanted to
copy. Which I soon found out I did not have to do.

It sounds like you are selecting a cell and then activating the procedure to
copy something from cell A600:D602, and then wanted that to be pasted
wherever you have selected.

If so, I think you could try this:

Range("A600:D602").Copy
Selection.Paste

I am sure the real gurus around here will have a better answer, but maybe
that will give you something to try until they answer.

Ken


"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a spreadsheet
at
a point where entries finish. This could be anywhere on the sheet. So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Insert cell anywhere

Hi J,

Assuming that column A is to be used to determine the end of existing data,
try:

Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub

---
Regards,
Norman



"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a spreadsheet
at
a point where entries finish. This could be anywhere on the sheet. So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert cell anywhere

Hi Ken,
Thanks for trying but at:- Selection.Paste I get a Runtime error '438'
Object doesn't support this property or method.

"Ken Loomis" wrote:

I am really not the expert here, but I wonder if you did what I always used
to do. That was to first select, via the VBA code, whatever I wanted to
copy. Which I soon found out I did not have to do.

It sounds like you are selecting a cell and then activating the procedure to
copy something from cell A600:D602, and then wanted that to be pasted
wherever you have selected.

If so, I think you could try this:

Range("A600:D602").Copy
Selection.Paste

I am sure the real gurus around here will have a better answer, but maybe
that will give you something to try until they answer.

Ken


"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a spreadsheet
at
a point where entries finish. This could be anywhere on the sheet. So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert cell anywhere

Thanks for trying Norman but at End(xlUp)(2)) I get 'compile Error Expected
expression' and I dont know how to sort it out.


"Norman Jones" wrote:

Hi J,

Assuming that column A is to be used to determine the end of existing data,
try:

Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub

---
Regards,
Norman



"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a spreadsheet
at
a point where entries finish. This could be anywhere on the sheet. So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Insert cell anywhere

Hi J,

I can't reproduce your problem.

Could you copy / paste your Sub's code into a reply?

---
Regards,
Norman



"J.Reynolds" wrote in message
...
Thanks for trying Norman but at End(xlUp)(2)) I get 'compile Error
Expected
expression' and I dont know how to sort it out.


"Norman Jones" wrote:

Hi J,

Assuming that column A is to be used to determine the end of existing
data,
try:

Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub

---
Regards,
Norman



"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a
spreadsheet
at
a point where entries finish. This could be anywhere on the sheet. So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert cell anywhere

Norman, I am new to this, it is easy in word but I am having trouble in
excel. So far I have:-
Sub Insert_Invoice_Total_Box()
Range ("A600:D602").Select
Selection.Copy
Range ("?").Select
ActiveSheet.Paste

EndSub

It is what to put for the question mark, it could be anywhere between A16
and A600. Reading other posts in the group J_Gold asked on 28th May "I would
like to be able to subtotal a column of numbers using the following formula:"
I havent been able to test that on my spreadsheet, but I dont mind if the
column doesn't subtotal I can do that manually, for now I want to insert
formatting so that I can subtotal, tax, shipping and total etc.
Thanks J.



"Norman Jones" wrote:

Hi J,

I can't reproduce your problem.

Could you copy / paste your Sub's code into a reply?

---
Regards,
Norman



"J.Reynolds" wrote in message
...
Thanks for trying Norman but at End(xlUp)(2)) I get 'compile Error
Expected
expression' and I dont know how to sort it out.


"Norman Jones" wrote:

Hi J,

Assuming that column A is to be used to determine the end of existing
data,
try:

Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub

---
Regards,
Norman



"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a
spreadsheet
at
a point where entries finish. This could be anywhere on the sheet. So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I selected
without stipulating an actual cell?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Insert cell anywhere

Hi J,

My original code:

'<<=====================
Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub
'=====================

works fine for me.

Did you copy / paste it into your workbook to avoid any transcription
errors?

BTW, the last line of a macro should be:

End Sub (two words)

not

EndSub (one word)

as shown in your Insert_Invoice_Total_Box() sub. although this is probably
a simple typo.

---
Regards,
Norman



"J.Reynolds" wrote in message
...
Norman, I am new to this, it is easy in word but I am having trouble in
excel. So far I have:-
Sub Insert_Invoice_Total_Box()
Range ("A600:D602").Select
Selection.Copy
Range ("?").Select
ActiveSheet.Paste

EndSub

It is what to put for the question mark, it could be anywhere between A16
and A600. Reading other posts in the group J_Gold asked on 28th May "I
would
like to be able to subtotal a column of numbers using the following
formula:"
I havent been able to test that on my spreadsheet, but I dont mind if the
column doesn't subtotal I can do that manually, for now I want to insert
formatting so that I can subtotal, tax, shipping and total etc.
Thanks J.



"Norman Jones" wrote:

Hi J,

I can't reproduce your problem.

Could you copy / paste your Sub's code into a reply?

---
Regards,
Norman



"J.Reynolds" wrote in message
...
Thanks for trying Norman but at End(xlUp)(2)) I get 'compile Error
Expected
expression' and I dont know how to sort it out.


"Norman Jones" wrote:

Hi J,

Assuming that column A is to be used to determine the end of existing
data,
try:

Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub

---
Regards,
Norman



"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a
spreadsheet
at
a point where entries finish. This could be anywhere on the sheet.
So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I
selected
without stipulating an actual cell?








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Insert cell anywhere

Thanks for replying again, I pasted your suggestion into my macro, it worked
but it only pasted it into rows 603,604 and 605. Is this because I have
formulas in all rows up to 599. As it is an invoice I would like to be able
to paste it just below the last entry, and this could be any row up to 600.
Regards J.

"Norman Jones" wrote:

Hi J,

My original code:

'<<=====================
Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub
'=====================

works fine for me.

Did you copy / paste it into your workbook to avoid any transcription
errors?

BTW, the last line of a macro should be:

End Sub (two words)

not

EndSub (one word)

as shown in your Insert_Invoice_Total_Box() sub. although this is probably
a simple typo.

---
Regards,
Norman



"J.Reynolds" wrote in message
...
Norman, I am new to this, it is easy in word but I am having trouble in
excel. So far I have:-
Sub Insert_Invoice_Total_Box()
Range ("A600:D602").Select
Selection.Copy
Range ("?").Select
ActiveSheet.Paste

EndSub

It is what to put for the question mark, it could be anywhere between A16
and A600. Reading other posts in the group J_Gold asked on 28th May "I
would
like to be able to subtotal a column of numbers using the following
formula:"
I havent been able to test that on my spreadsheet, but I dont mind if the
column doesn't subtotal I can do that manually, for now I want to insert
formatting so that I can subtotal, tax, shipping and total etc.
Thanks J.



"Norman Jones" wrote:

Hi J,

I can't reproduce your problem.

Could you copy / paste your Sub's code into a reply?

---
Regards,
Norman



"J.Reynolds" wrote in message
...
Thanks for trying Norman but at End(xlUp)(2)) I get 'compile Error
Expected
expression' and I dont know how to sort it out.


"Norman Jones" wrote:

Hi J,

Assuming that column A is to be used to determine the end of existing
data,
try:

Sub Tester04()

With ActiveSheet
.Range("A600:D602").Copy
.Paste (.Cells(Rows.Count, "A").End(xlUp)(2))
End With
End Sub

---
Regards,
Norman



"J.Reynolds" wrote in message
...
I am trying to insert some cells that I have formatted into a
spreadsheet
at
a point where entries finish. This could be anywhere on the sheet.
So
far I
have managed:- Range("A600:D602").Select
Selection.Copy
Range("..????")Select
Active Sheet Paste.
How can I tell the macro to enter my cells at the cell which I
selected
without stipulating an actual cell?









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
'IF' Macro to insert cell contents to alternate cell if cell not e Gryndar Excel Worksheet Functions 6 December 20th 08 05:02 PM
Insert a value in a cell based upon a comparison of cell values in 2 separate worksheets Doctorjones_md Excel Discussion (Misc queries) 7 June 8th 07 09:32 PM
Insert a value in a cell based upon a comparison of cell values in 2 separate worksheets Doctorjones_md Excel Worksheet Functions 7 June 8th 07 09:32 PM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


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