ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find and paste (https://www.excelbanter.com/excel-programming/335456-find-paste.html)

ceemo[_2_]

find and paste
 

hi im needing some help. I want some VB code to copy range B2:F2 an
searching from B6 down paste it in the first blank cell

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=38993


ceemo[_3_]

find and paste
 

thank you for your reply. m getting debug error on the following line

Do While Not Cells(iIndex, 2) = Empt

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=38993


TommySzalapski[_2_]

find and paste
 

Oops, if you copy-pasted my code change line

Index = 6

to

iIndex = 6

Sorry about that. You're getting the error because iIndex was neve
set to anything in my errored code

--
TommySzalapsk
-----------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...fo&userid=2556
View this thread: http://www.excelforum.com/showthread.php?threadid=38993


ceemo[_5_]

find and paste
 

im having a little diff still
ive tried to mod your code to this


Range("B2:F2").Copy

Dim iIndex As Integer

iIndex = 6

Do While Not Cells(iIndex, 2) = Empty



iIndex = iIndex + 1

Loop
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
SkipBlanks _
:=False, Transpose:=False


im not getting any joy though, do you know why its not workin

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=38993


TommySzalapski[_4_]

find and paste
 

after the loop exits add

Cells(iIndex,2).select

or change

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
SkipBlanks _
:=False, Transpose:=False

to

Cells(iIndex,2).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
SkipBlanks _
:=False, Transpose:=Fals

--
TommySzalapsk
-----------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...fo&userid=2556
View this thread: http://www.excelforum.com/showthread.php?threadid=38993


ceemo[_4_]

find and paste
 

thnx it works perfectl

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=38993



All times are GMT +1. The time now is 09:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com