Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default How to set macro to Paste Special Value to next empty column

Range("P32,Q7:Q32").Select
Range("Q7").Activate
ActiveWindow.SmallScroll Down:=-12
Range("Q7:Q32").Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False



I try to use the control left then click the right button to go to the
next empty column. However, the macro fail to copy to the next
available column.

Please help. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default How to set macro to Paste Special Value to next empty column

try

Sub makevalues()
mc = "q"
sr=7
lr = Cells(Rows.Count, mc).End(xlUp).Row
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
Range(Cells(sr, mc), Cells(lr, mc)).Copy
Cells(sr, nc).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
Range("P32,Q7:Q32").Select
Range("Q7").Activate
ActiveWindow.SmallScroll Down:=-12
Range("Q7:Q32").Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False



I try to use the control left then click the right button to go to the
next empty column. However, the macro fail to copy to the next
available column.

Please help. Thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default How to set macro to Paste Special Value to next empty column

On May 5, 11:07 pm, "Don Guillett" wrote:
try

Sub makevalues()
mc = "q"
sr=7
lr = Cells(Rows.Count, mc).End(xlUp).Row
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
Range(Cells(sr, mc), Cells(lr, mc)).Copy
Cells(sr, nc).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

Range("P32,Q7:Q32").Select
Range("Q7").Activate
ActiveWindow.SmallScroll Down:=-12
Range("Q7:Q32").Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


I try to use the control left then click the right button to go to the
next empty column. However, the macro fail to copy to the next
available column.


Please help. Thanks


Thanks for the response. However, the value get pasted to the column
R. What happen is that my values in column Q is updated monthly. After
each update i need to paste special value to column C then column D in
the next month and so on. So i need the macro to recognise the next
empty column to the left of column Q. Please help. Thanks
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default How to set macro to Paste Special Value to next empty column

nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
nc = Cells(sr, mc).End(xlToLeft).Column + 1


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
On May 5, 11:07 pm, "Don Guillett" wrote:
try

Sub makevalues()
mc = "q"
sr=7
lr = Cells(Rows.Count, mc).End(xlUp).Row
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
Range(Cells(sr, mc), Cells(lr, mc)).Copy
Cells(sr, nc).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

Range("P32,Q7:Q32").Select
Range("Q7").Activate
ActiveWindow.SmallScroll Down:=-12
Range("Q7:Q32").Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


I try to use the control left then click the right button to go to the
next empty column. However, the macro fail to copy to the next
available column.


Please help. Thanks


Thanks for the response. However, the value get pasted to the column
R. What happen is that my values in column Q is updated monthly. After
each update i need to paste special value to column C then column D in
the next month and so on. So i need the macro to recognise the next
empty column to the left of column Q. Please help. Thanks


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default How to set macro to Paste Special Value to next empty column

On May 6, 12:00 am, "Don Guillett" wrote:
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
nc = Cells(sr, mc).End(xlToLeft).Column + 1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

On May 5, 11:07 pm, "Don Guillett" wrote:
try


Sub makevalues()
mc = "q"
sr=7
lr = Cells(Rows.Count, mc).End(xlUp).Row
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
Range(Cells(sr, mc), Cells(lr, mc)).Copy
Cells(sr, nc).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message


...


Range("P32,Q7:Q32").Select
Range("Q7").Activate
ActiveWindow.SmallScroll Down:=-12
Range("Q7:Q32").Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


I try to use the control left then click the right button to go to the
next empty column. However, the macro fail to copy to the next
available column.


Please help. Thanks


Thanks for the response. However, the value get pasted to the column
R. What happen is that my values in column Q is updated monthly. After
each update i need to paste special value to column C then column D in
the next month and so on. So i need the macro to recognise the next
empty column to the left of column Q. Please help. Thanks


Where do i put this 2 lines?


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default How to set macro to Paste Special Value to next empty column

First. Many of us prefer TOP posting here.
Second. Put on your thinking cap and look at the macro againand again.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
On May 6, 12:00 am, "Don Guillett" wrote:
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
nc = Cells(sr, mc).End(xlToLeft).Column + 1

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

On May 5, 11:07 pm, "Don Guillett" wrote:
try


Sub makevalues()
mc = "q"
sr=7
lr = Cells(Rows.Count, mc).End(xlUp).Row
nc = Cells(sr, Columns.Count).End(xlToLeft).Column + 1
Range(Cells(sr, mc), Cells(lr, mc)).Copy
Cells(sr, nc).PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message


...


Range("P32,Q7:Q32").Select
Range("Q7").Activate
ActiveWindow.SmallScroll Down:=-12
Range("Q7:Q32").Select
Selection.Copy
Selection.End(xlToLeft).Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


I try to use the control left then click the right button to go to
the
next empty column. However, the macro fail to copy to the next
available column.


Please help. Thanks


Thanks for the response. However, the value get pasted to the column
R. What happen is that my values in column Q is updated monthly. After
each update i need to paste special value to column C then column D in
the next month and so on. So i need the macro to recognise the next
empty column to the left of column Q. Please help. Thanks


Where do i put this 2 lines?


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
PASTE SPECIAL w/ Macro Jase Excel Discussion (Misc queries) 7 February 26th 08 06:06 PM
paste special / skip empty cells doesn't work!? Ivica TypeR Excel Worksheet Functions 3 July 10th 07 04:53 PM
Macro - Auto Paste Special Tom Hewitt Excel Discussion (Misc queries) 0 May 15th 07 06:35 PM
Paste Special Macro - can't undo Ben New Users to Excel 2 May 10th 07 03:44 AM
Paste Special in a macro CMAC Excel Worksheet Functions 2 December 6th 04 10:19 PM


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