#1   Report Post  
Junior Member
 
Posts: 20
Default End(xlDown) Issue

No matter what I do I just cant get it to go to the right position. If it worked correctly the macro would copy cells A2:O33, copy them, activate sheet "Variables QS", Then select the next open cell in column B and paste the earlier selection.

That is it. and I just cant get it to work, I never had this issue before.

Heres the code im using:

Code:
Sub SavingTable()
'
' SavingTable Macro
'
'
    Range("A2:O33").Select
    Selection.Copy
    Sheets("Variables QS").Select
    Range("B1").End(xlDown).Offset(-1,0).Select
    ActiveSheet.Paste
    Sheets("Variables").Select
    Range("G1").Select
    Selection.Copy
    Sheets("VariablesQS").Select
    Range("A1").End(xlDown).Offset(-1,0).Select
    ActiveSheet.Paste
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 852
Default End(xlDown) Issue

On Monday, April 14, 2014 2:35:43 PM UTC-7, Pistolade wrote:
No matter what I do I just cant get it to go to the right position. If

it worked correctly the macro would copy cells A2:O33, copy them,

activate sheet "Variables QS", Then select the next open cell in column

B and paste the earlier selection.



That is it. and I just cant get it to work, I never had this issue

before.



Heres the code im using:





Code:

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



Sub SavingTable()

'

' SavingTable Macro

'

'

Range("A2:O33").Select

Selection.Copy

Sheets("Variables QS").Select

Range("B1").End(xlDown).Offset(-1,0).Select

ActiveSheet.Paste

Sheets("Variables").Select

Range("G1").Select

Selection.Copy

Sheets("VariablesQS").Select

Range("A1").End(xlDown).Offset(-1,0).Select

ActiveSheet.Paste

End Sub



Pistolade


Try to work this into your code, no need to select.

Range("A2:O33").Copy Sheets("Variables QS").Range("B" & Rows.Count).End(xlUp)(2)


Regards,
Howard
  #3   Report Post  
Junior Member
 
Posts: 20
Default

Quote:
Originally Posted by L. Howard View Post
On Monday, April 14, 2014 2:35:43 PM UTC-7, Pistolade wrote:
No matter what I do I just cant get it to go to the right position. If

it worked correctly the macro would copy cells A2:O33, copy them,

activate sheet "Variables QS", Then select the next open cell in column

B and paste the earlier selection.



That is it. and I just cant get it to work, I never had this issue

before.



Heres the code im using:





Code:

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



Sub SavingTable()

'

' SavingTable Macro

'

'

Range("A2:O33").Select

Selection.Copy

Sheets("Variables QS").Select

Range("B1").End(xlDown).Offset(-1,0).Select

ActiveSheet.Paste

Sheets("Variables").Select

Range("G1").Select

Selection.Copy

Sheets("VariablesQS").Select

Range("A1").End(xlDown).Offset(-1,0).Select

ActiveSheet.Paste

End Sub



Pistolade


Try to work this into your code, no need to select.

Range("A2:O33").Copy Sheets("Variables QS").Range("B" & Rows.Count).End(xlUp)(2)


Regards,
Howard
Code:
 
Sub SavingTable()
'
' SavingTable Macro
'
NewJob = InputBox("Enter job name", "Job Label")
'
    Range("A2:O33").Copy
    Sheets("VariablesQS").Activate
    Range("C" & Rows.Count).End(xlUp).Offset(1, -1).Select
    ActiveSheet.Paste
    ActiveWorkbook.Names.Add Name:="VariablesFor" & NewJob, RefersTo:=Selection
    Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = NewJob
    Sheets("Variables").Activate
    
End Sub
This is what I ended up going with, and its just about right (for anyone who is looking for a fix)
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
End(xlDown) Normek Excel Programming 5 July 13th 09 10:46 AM
A1:B(xlDown)? Simon[_2_] Excel Programming 5 July 29th 08 10:23 AM
End(xldown) not always going to last cell? Duncan[_5_] Excel Programming 6 May 4th 06 10:30 AM
XlDown: Go to next blank row tomwashere2 Excel Programming 2 August 16th 05 11:15 PM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


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