Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fixing macro to choose a blank row

Hi

I am trying to get this macro to paste the data into a blank row on
another sheet any ideas?

Private Sub SUBMIT_Click()
Application.ScreenUpdating = False
Sheets("LOG TASK").Select
Range("b1:b10").Select
Selection.Copy
Sheets("TASKS TO DO").Select
Range("A1").End(xlDown)(2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Fixing macro to choose a blank row

Hi Nick,

One way:

'=============
Private Sub SUBMIT_Click()
Dim srcRng As Range
Dim destRng As Range

Set srcRng = Sheets("LOG TASK").Range("B1:B10")
Set destRng = Sheets("TASKS TO DO"). _
Cells(Rows.Count, "A").End(xlUp)(2)

With srcRng
destRng.Resize(.Rows.Count, .Columns.Count).Value = .Value
End With

End Sub
'<<=============


---
Regards,
Norman


wrote in message
oups.com...
Hi

I am trying to get this macro to paste the data into a blank row on
another sheet any ideas?

Private Sub SUBMIT_Click()
Application.ScreenUpdating = False
Sheets("LOG TASK").Select
Range("b1:b10").Select
Selection.Copy
Sheets("TASKS TO DO").Select
Range("A1").End(xlDown)(2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Fixing macro to choose a blank row

Thanks , that works great. the only problem i have is the pasted data
needs to go from being in a column to a row.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Fixing macro to choose a blank row

Hi Nick,

Thanks , that works great. the only problem i have is the pasted data
needs to go from being in a column to a row.


Try:
'=============
Private Sub SUBMIT_Click()
Dim srcRng As Range
Dim destRng As Range

Set srcRng = Sheets("LOG TASK").Range("B1:B10")
Set destRng = Sheets("TASKS TO DO"). _
Cells(Rows.Count, "A").End(xlUp)(2)

With srcRng
destRng.Resize(1, .Rows.Count).Value = _
Application.Transpose(.Value)
End With

End Sub
'<<=============

Alternatively, try:
'=============
Private Sub SUBMIT_Click()
Dim srcRng As Range
Dim destRng As Range

Set srcRng = Sheets("LOG TASK").Range("B1:B10")
Set destRng = Sheets("TASKS TO DO"). _
Cells(Rows.Count, "A").End(xlUp)(2)

srcRng.Copy
destRng.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=True
Application.CutCopyMode = False
End Sub
'<<=============


---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Fixing macro to choose a blank row

Thats great first one works a charm Thank you



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
Fixing the date format in a macro or VBA Geoff B Excel Worksheet Functions 1 September 7th 09 11:00 AM
Fixing a vlookup macro that returns #N/A error Grosvenor Excel Discussion (Misc queries) 1 February 8th 06 12:23 PM
Fixing SSN's with a macro Bruce Martin Excel Programming 5 June 18th 05 06:36 AM
Fixing a Macro-related Crash in Excel Danimagus[_5_] Excel Programming 1 June 6th 05 06:37 PM
Help Fixing Coloring Macro Tysone Excel Programming 2 January 20th 05 06:25 PM


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

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"