A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA Code- Copy & Paste in Blank Range



 
 
Thread Tools Display Modes
  #1  
Old March 19th 08, 11:08 PM posted to microsoft.public.excel.misc
Youlan
external usenet poster
 
Posts: 18
Default VBA Code- Copy & Paste in Blank Range

Hi,

I'm using Excel 2002

I'm trying to write a code to copy and paste special a range of data in the
next empty cell. Therefore if cell j5 has data it would start pasting it in
only k5 and so on. This is what I have so far but its pasting in all the
columns where row 5 is blank:

If Range("j5").Value = " " Then

End If

ActiveWindow.SmallScroll ToRight:=-1
Range("D593").Select
Selection.copy
ActiveWindow.SmallScroll Down:=-123
ActiveWindow.SmallScroll ToRight:=15
ActiveWindow.SmallScroll Down:=-15
Range("j5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

End If

Else

I would greatly appreciate any help with this. Thanks in advance.
Ads
  #4  
Old March 20th 08, 10:45 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 10,124
Default VBA Code- Copy & Paste in Blank Range

Youlan wrote
_______________?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Youlan" > wrote in message
...
>
>
> "Don Guillett" wrote:
>
>> sub copytonextcol()
>> mr=5 'row
>> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
>> Range("D593").copy
>> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
>> end sub
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>>

>> "Youlan" > wrote in message
>> ...
>> > Hi,
>> >
>> > I'm using Excel 2002
>> >
>> > I'm trying to write a code to copy and paste special a range of data in
>> > the
>> > next empty cell. Therefore if cell j5 has data it would start pasting
>> > it
>> > in
>> > only k5 and so on. This is what I have so far but its pasting in all
>> > the
>> > columns where row 5 is blank:
>> >
>> > If Range("j5").Value = " " Then
>> >
>> > End If
>> >
>> > ActiveWindow.SmallScroll ToRight:=-1
>> > Range("D593").Select
>> > Selection.copy
>> > ActiveWindow.SmallScroll Down:=-123
>> > ActiveWindow.SmallScroll ToRight:=15
>> > ActiveWindow.SmallScroll Down:=-15
>> > Range("j5").Select
>> > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
>> > SkipBlanks _
>> > :=False, Transpose:=False
>> >
>> > End If
>> >
>> > Else
>> >
>> > I would greatly appreciate any help with this. Thanks in advance.

>>
>>


  #5  
Old March 20th 08, 11:30 PM posted to microsoft.public.excel.misc
Youlan
external usenet poster
 
Posts: 18
Default VBA Code- Copy & Paste in Blank Range

Hi Don,

I don't know why you wern't able to see what I wrote before.

Thanks for your help but I am still having a little problem because when I
run the macro I get the following compile error:

"Expected End Sub"

Can you help please?

"Don Guillett" wrote:

> Youlan wrote
> _______________?
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
>
> "Youlan" > wrote in message
> ...
> >
> >
> > "Don Guillett" wrote:
> >
> >> sub copytonextcol()
> >> mr=5 'row
> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
> >> Range("D593").copy
> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
> >> end sub
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >>

> >> "Youlan" > wrote in message
> >> ...
> >> > Hi,
> >> >
> >> > I'm using Excel 2002
> >> >
> >> > I'm trying to write a code to copy and paste special a range of data in
> >> > the
> >> > next empty cell. Therefore if cell j5 has data it would start pasting
> >> > it
> >> > in
> >> > only k5 and so on. This is what I have so far but its pasting in all
> >> > the
> >> > columns where row 5 is blank:
> >> >
> >> > If Range("j5").Value = " " Then
> >> >
> >> > End If
> >> >
> >> > ActiveWindow.SmallScroll ToRight:=-1
> >> > Range("D593").Select
> >> > Selection.copy
> >> > ActiveWindow.SmallScroll Down:=-123
> >> > ActiveWindow.SmallScroll ToRight:=15
> >> > ActiveWindow.SmallScroll Down:=-15
> >> > Range("j5").Select
> >> > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
> >> > SkipBlanks _
> >> > :=False, Transpose:=False
> >> >
> >> > End If
> >> >
> >> > Else
> >> >
> >> > I would greatly appreciate any help with this. Thanks in advance.
> >>
> >>

>
>

  #6  
Old March 20th 08, 11:41 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 10,124
Default VBA Code- Copy & Paste in Blank Range

Did you copy all lines?

sub copytonextcol()
mr=5 'row
lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
Range("D593").copy
cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
'line below added
Application.CutCopyMode = False
end sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Youlan" > wrote in message
...
> Hi Don,
>
> I don't know why you wern't able to see what I wrote before.
>
> Thanks for your help but I am still having a little problem because when I
> run the macro I get the following compile error:
>
> "Expected End Sub"
>
> Can you help please?
>
> "Don Guillett" wrote:
>
>> Youlan wrote
>> _______________?
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>>

>> "Youlan" > wrote in message
>> ...
>> >
>> >
>> > "Don Guillett" wrote:
>> >
>> >> sub copytonextcol()
>> >> mr=5 'row
>> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
>> >> Range("D593").copy
>> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
>> >> end sub
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >>

>> >> "Youlan" > wrote in message
>> >> ...
>> >> > Hi,
>> >> >
>> >> > I'm using Excel 2002
>> >> >
>> >> > I'm trying to write a code to copy and paste special a range of data
>> >> > in
>> >> > the
>> >> > next empty cell. Therefore if cell j5 has data it would start
>> >> > pasting
>> >> > it
>> >> > in
>> >> > only k5 and so on. This is what I have so far but its pasting in all
>> >> > the
>> >> > columns where row 5 is blank:
>> >> >
>> >> > If Range("j5").Value = " " Then
>> >> >
>> >> > End If
>> >> >
>> >> > ActiveWindow.SmallScroll ToRight:=-1
>> >> > Range("D593").Select
>> >> > Selection.copy
>> >> > ActiveWindow.SmallScroll Down:=-123
>> >> > ActiveWindow.SmallScroll ToRight:=15
>> >> > ActiveWindow.SmallScroll Down:=-15
>> >> > Range("j5").Select
>> >> > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
>> >> > SkipBlanks _
>> >> > :=False, Transpose:=False
>> >> >
>> >> > End If
>> >> >
>> >> > Else
>> >> >
>> >> > I would greatly appreciate any help with this. Thanks in advance.
>> >>
>> >>

>>
>>


  #7  
Old March 21st 08, 12:07 AM posted to microsoft.public.excel.misc
Youlan
external usenet poster
 
Posts: 18
Default VBA Code- Copy & Paste in Blank Range

Thanks Don,

It works but not with a commandbutton ( I was doing it with a command button
before maybe thats why it wasn't working before)

Also I wanted it to start pasting in the next blank column (starting at row
5) not the last column and not the entire column. Also this process is to be
repeated everytime the macro is evoked. Can this be done?

I hope I'm not giving you too much trouble. Thanks again.

"Don Guillett" wrote:

> Did you copy all lines?
>
> sub copytonextcol()
> mr=5 'row
> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
> Range("D593").copy
> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
> 'line below added
> Application.CutCopyMode = False
> end sub
>
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
>
> "Youlan" > wrote in message
> ...
> > Hi Don,
> >
> > I don't know why you wern't able to see what I wrote before.
> >
> > Thanks for your help but I am still having a little problem because when I
> > run the macro I get the following compile error:
> >
> > "Expected End Sub"
> >
> > Can you help please?
> >
> > "Don Guillett" wrote:
> >
> >> Youlan wrote
> >> _______________?
> >>
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >>

> >> "Youlan" > wrote in message
> >> ...
> >> >
> >> >
> >> > "Don Guillett" wrote:
> >> >
> >> >> sub copytonextcol()
> >> >> mr=5 'row
> >> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
> >> >> Range("D593").copy
> >> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
> >> >> end sub
> >> >> --
> >> >> Don Guillett
> >> >> Microsoft MVP Excel
> >> >> SalesAid Software
> >> >>

> >> >> "Youlan" > wrote in message
> >> >> ...
> >> >> > Hi,
> >> >> >
> >> >> > I'm using Excel 2002
> >> >> >
> >> >> > I'm trying to write a code to copy and paste special a range of data
> >> >> > in
> >> >> > the
> >> >> > next empty cell. Therefore if cell j5 has data it would start
> >> >> > pasting
> >> >> > it
> >> >> > in
> >> >> > only k5 and so on. This is what I have so far but its pasting in all
> >> >> > the
> >> >> > columns where row 5 is blank:
> >> >> >
> >> >> > If Range("j5").Value = " " Then
> >> >> >
> >> >> > End If
> >> >> >
> >> >> > ActiveWindow.SmallScroll ToRight:=-1
> >> >> > Range("D593").Select
> >> >> > Selection.copy
> >> >> > ActiveWindow.SmallScroll Down:=-123
> >> >> > ActiveWindow.SmallScroll ToRight:=15
> >> >> > ActiveWindow.SmallScroll Down:=-15
> >> >> > Range("j5").Select
> >> >> > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
> >> >> > SkipBlanks _
> >> >> > :=False, Transpose:=False
> >> >> >
> >> >> > End If
> >> >> >
> >> >> > Else
> >> >> >
> >> >> > I would greatly appreciate any help with this. Thanks in advance.
> >> >>
> >> >>
> >>
> >>

>
>

  #8  
Old March 21st 08, 12:50 AM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 10,124
Default VBA Code- Copy & Paste in Blank Range

So I don't have to re-create, send a workbook along with what you want. Most
never use command buttons. I usually asign to a shape. Did one for a client
the other day assigned to his logo.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Youlan" > wrote in message
...
> Thanks Don,
>
> It works but not with a commandbutton ( I was doing it with a command
> button
> before maybe thats why it wasn't working before)
>
> Also I wanted it to start pasting in the next blank column (starting at
> row
> 5) not the last column and not the entire column. Also this process is to
> be
> repeated everytime the macro is evoked. Can this be done?
>
> I hope I'm not giving you too much trouble. Thanks again.
>
> "Don Guillett" wrote:
>
>> Did you copy all lines?
>>
>> sub copytonextcol()
>> mr=5 'row
>> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
>> Range("D593").copy
>> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
>> 'line below added
>> Application.CutCopyMode = False
>> end sub
>>
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>>

>> "Youlan" > wrote in message
>> ...
>> > Hi Don,
>> >
>> > I don't know why you wern't able to see what I wrote before.
>> >
>> > Thanks for your help but I am still having a little problem because
>> > when I
>> > run the macro I get the following compile error:
>> >
>> > "Expected End Sub"
>> >
>> > Can you help please?
>> >
>> > "Don Guillett" wrote:
>> >
>> >> Youlan wrote
>> >> _______________?
>> >>
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >>

>> >> "Youlan" > wrote in message
>> >> ...
>> >> >
>> >> >
>> >> > "Don Guillett" wrote:
>> >> >
>> >> >> sub copytonextcol()
>> >> >> mr=5 'row
>> >> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
>> >> >> Range("D593").copy
>> >> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
>> >> >> end sub
>> >> >> --
>> >> >> Don Guillett
>> >> >> Microsoft MVP Excel
>> >> >> SalesAid Software
>> >> >>

>> >> >> "Youlan" > wrote in message
>> >> >> ...
>> >> >> > Hi,
>> >> >> >
>> >> >> > I'm using Excel 2002
>> >> >> >
>> >> >> > I'm trying to write a code to copy and paste special a range of
>> >> >> > data
>> >> >> > in
>> >> >> > the
>> >> >> > next empty cell. Therefore if cell j5 has data it would start
>> >> >> > pasting
>> >> >> > it
>> >> >> > in
>> >> >> > only k5 and so on. This is what I have so far but its pasting in
>> >> >> > all
>> >> >> > the
>> >> >> > columns where row 5 is blank:
>> >> >> >
>> >> >> > If Range("j5").Value = " " Then
>> >> >> >
>> >> >> > End If
>> >> >> >
>> >> >> > ActiveWindow.SmallScroll ToRight:=-1
>> >> >> > Range("D593").Select
>> >> >> > Selection.copy
>> >> >> > ActiveWindow.SmallScroll Down:=-123
>> >> >> > ActiveWindow.SmallScroll ToRight:=15
>> >> >> > ActiveWindow.SmallScroll Down:=-15
>> >> >> > Range("j5").Select
>> >> >> > Selection.PasteSpecial Paste:=xlPasteValues,
>> >> >> > Operation:=xlNone,
>> >> >> > SkipBlanks _
>> >> >> > :=False, Transpose:=False
>> >> >> >
>> >> >> > End If
>> >> >> >
>> >> >> > Else
>> >> >> >
>> >> >> > I would greatly appreciate any help with this. Thanks in advance.
>> >> >>
>> >> >>
>> >>
>> >>

>>
>>


  #9  
Old March 25th 08, 06:00 PM posted to microsoft.public.excel.misc
Youlan
external usenet poster
 
Posts: 18
Default VBA Code- Copy & Paste in Blank Range

Hi Don,

Yeah, I realize command buttons can be a little finicky. I'll just use a
graphic.

I'm going to send the workbook to the e-mail address. I've typed what I want
to do in the comments in D4.

Thanks again

"Don Guillett" wrote:

> So I don't have to re-create, send a workbook along with what you want. Most
> never use command buttons. I usually asign to a shape. Did one for a client
> the other day assigned to his logo.
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
>
> "Youlan" > wrote in message
> ...
> > Thanks Don,
> >
> > It works but not with a commandbutton ( I was doing it with a command
> > button
> > before maybe thats why it wasn't working before)
> >
> > Also I wanted it to start pasting in the next blank column (starting at
> > row
> > 5) not the last column and not the entire column. Also this process is to
> > be
> > repeated everytime the macro is evoked. Can this be done?
> >
> > I hope I'm not giving you too much trouble. Thanks again.
> >
> > "Don Guillett" wrote:
> >
> >> Did you copy all lines?
> >>
> >> sub copytonextcol()
> >> mr=5 'row
> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
> >> Range("D593").copy
> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
> >> 'line below added
> >> Application.CutCopyMode = False
> >> end sub
> >>
> >>
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >>

> >> "Youlan" > wrote in message
> >> ...
> >> > Hi Don,
> >> >
> >> > I don't know why you wern't able to see what I wrote before.
> >> >
> >> > Thanks for your help but I am still having a little problem because
> >> > when I
> >> > run the macro I get the following compile error:
> >> >
> >> > "Expected End Sub"
> >> >
> >> > Can you help please?
> >> >
> >> > "Don Guillett" wrote:
> >> >
> >> >> Youlan wrote
> >> >> _______________?
> >> >>
> >> >> --
> >> >> Don Guillett
> >> >> Microsoft MVP Excel
> >> >> SalesAid Software
> >> >>

> >> >> "Youlan" > wrote in message
> >> >> ...
> >> >> >
> >> >> >
> >> >> > "Don Guillett" wrote:
> >> >> >
> >> >> >> sub copytonextcol()
> >> >> >> mr=5 'row
> >> >> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
> >> >> >> Range("D593").copy
> >> >> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
> >> >> >> end sub
> >> >> >> --
> >> >> >> Don Guillett
> >> >> >> Microsoft MVP Excel
> >> >> >> SalesAid Software
> >> >> >>

> >> >> >> "Youlan" > wrote in message
> >> >> >> ...
> >> >> >> > Hi,
> >> >> >> >
> >> >> >> > I'm using Excel 2002
> >> >> >> >
> >> >> >> > I'm trying to write a code to copy and paste special a range of
> >> >> >> > data
> >> >> >> > in
> >> >> >> > the
> >> >> >> > next empty cell. Therefore if cell j5 has data it would start
> >> >> >> > pasting
> >> >> >> > it
> >> >> >> > in
> >> >> >> > only k5 and so on. This is what I have so far but its pasting in
> >> >> >> > all
> >> >> >> > the
> >> >> >> > columns where row 5 is blank:
> >> >> >> >
> >> >> >> > If Range("j5").Value = " " Then
> >> >> >> >
> >> >> >> > End If
> >> >> >> >
> >> >> >> > ActiveWindow.SmallScroll ToRight:=-1
> >> >> >> > Range("D593").Select
> >> >> >> > Selection.copy
> >> >> >> > ActiveWindow.SmallScroll Down:=-123
> >> >> >> > ActiveWindow.SmallScroll ToRight:=15
> >> >> >> > ActiveWindow.SmallScroll Down:=-15
> >> >> >> > Range("j5").Select
> >> >> >> > Selection.PasteSpecial Paste:=xlPasteValues,
> >> >> >> > Operation:=xlNone,
> >> >> >> > SkipBlanks _
> >> >> >> > :=False, Transpose:=False
> >> >> >> >
> >> >> >> > End If
> >> >> >> >
> >> >> >> > Else
> >> >> >> >
> >> >> >> > I would greatly appreciate any help with this. Thanks in advance.
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >>
> >>

>
>

  #10  
Old March 27th 08, 04:22 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 10,124
Default VBA Code- Copy & Paste in Blank Range

Sent him this.

Sub CopyToNextAvailCol()
mr = 5
mc = "d"
lc = Cells(mr, mc).End(xlToRight).Column + 1
Range(Cells(mr, "f"), Cells(93, "f")).Value = _
Range(Cells(mr, lc - 1), Cells(93, lc - 1)).Value
Range(Cells(mr, lc), Cells(93, lc)).Value = _
Range(Cells(mr, mc), Cells(93, mc)).Value
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Youlan" > wrote in message
...
> Hi Don,
>
> Yeah, I realize command buttons can be a little finicky. I'll just use a
> graphic.
>
> I'm going to send the workbook to the e-mail address. I've typed what I
> want
> to do in the comments in D4.
>
> Thanks again
>
> "Don Guillett" wrote:
>
>> So I don't have to re-create, send a workbook along with what you want.
>> Most
>> never use command buttons. I usually asign to a shape. Did one for a
>> client
>> the other day assigned to his logo.
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>>

>> "Youlan" > wrote in message
>> ...
>> > Thanks Don,
>> >
>> > It works but not with a commandbutton ( I was doing it with a command
>> > button
>> > before maybe thats why it wasn't working before)
>> >
>> > Also I wanted it to start pasting in the next blank column (starting at
>> > row
>> > 5) not the last column and not the entire column. Also this process is
>> > to
>> > be
>> > repeated everytime the macro is evoked. Can this be done?
>> >
>> > I hope I'm not giving you too much trouble. Thanks again.
>> >
>> > "Don Guillett" wrote:
>> >
>> >> Did you copy all lines?
>> >>
>> >> sub copytonextcol()
>> >> mr=5 'row
>> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
>> >> Range("D593").copy
>> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
>> >> 'line below added
>> >> Application.CutCopyMode = False
>> >> end sub
>> >>
>> >>
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >>

>> >> "Youlan" > wrote in message
>> >> ...
>> >> > Hi Don,
>> >> >
>> >> > I don't know why you wern't able to see what I wrote before.
>> >> >
>> >> > Thanks for your help but I am still having a little problem because
>> >> > when I
>> >> > run the macro I get the following compile error:
>> >> >
>> >> > "Expected End Sub"
>> >> >
>> >> > Can you help please?
>> >> >
>> >> > "Don Guillett" wrote:
>> >> >
>> >> >> Youlan wrote
>> >> >> _______________?
>> >> >>
>> >> >> --
>> >> >> Don Guillett
>> >> >> Microsoft MVP Excel
>> >> >> SalesAid Software
>> >> >>

>> >> >> "Youlan" > wrote in message
>> >> >> ...
>> >> >> >
>> >> >> >
>> >> >> > "Don Guillett" wrote:
>> >> >> >
>> >> >> >> sub copytonextcol()
>> >> >> >> mr=5 'row
>> >> >> >> lastcol=cells(mr,columns.count).end(xltoleft).colu mn+1
>> >> >> >> Range("D593").copy
>> >> >> >> cells(mr,lastcol).PasteSpecial Paste:=xlPasteValues
>> >> >> >> end sub
>> >> >> >> --
>> >> >> >> Don Guillett
>> >> >> >> Microsoft MVP Excel
>> >> >> >> SalesAid Software
>> >> >> >>

>> >> >> >> "Youlan" > wrote in message
>> >> >> >> ...
>> >> >> >> > Hi,
>> >> >> >> >
>> >> >> >> > I'm using Excel 2002
>> >> >> >> >
>> >> >> >> > I'm trying to write a code to copy and paste special a range
>> >> >> >> > of
>> >> >> >> > data
>> >> >> >> > in
>> >> >> >> > the
>> >> >> >> > next empty cell. Therefore if cell j5 has data it would start
>> >> >> >> > pasting
>> >> >> >> > it
>> >> >> >> > in
>> >> >> >> > only k5 and so on. This is what I have so far but its pasting
>> >> >> >> > in
>> >> >> >> > all
>> >> >> >> > the
>> >> >> >> > columns where row 5 is blank:
>> >> >> >> >
>> >> >> >> > If Range("j5").Value = " " Then
>> >> >> >> >
>> >> >> >> > End If
>> >> >> >> >
>> >> >> >> > ActiveWindow.SmallScroll ToRight:=-1
>> >> >> >> > Range("D593").Select
>> >> >> >> > Selection.copy
>> >> >> >> > ActiveWindow.SmallScroll Down:=-123
>> >> >> >> > ActiveWindow.SmallScroll ToRight:=15
>> >> >> >> > ActiveWindow.SmallScroll Down:=-15
>> >> >> >> > Range("j5").Select
>> >> >> >> > Selection.PasteSpecial Paste:=xlPasteValues,
>> >> >> >> > Operation:=xlNone,
>> >> >> >> > SkipBlanks _
>> >> >> >> > :=False, Transpose:=False
>> >> >> >> >
>> >> >> >> > End If
>> >> >> >> >
>> >> >> >> > Else
>> >> >> >> >
>> >> >> >> > I would greatly appreciate any help with this. Thanks in
>> >> >> >> > advance.
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> >>
>> >>

>>
>>


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy and paste using vb code ASU Excel Discussion (Misc queries) 1 September 10th 06 01:41 AM
copy and paste formula using vb code ASU Excel Discussion (Misc queries) 4 September 7th 06 08:56 PM
VBA-code for search,copy and paste TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 December 12th 05 01:40 PM
CheckBox Code to copy & paste range Casey Excel Discussion (Misc queries) 0 October 13th 05 05:32 PM
copy and paste code problem bigdaddy3 Excel Worksheet Functions 10 September 21st 05 05:55 PM


All times are GMT +1. The time now is 03:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.