Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2017, 06:49 PM
altina altina is offline Windows 10 Office 2016
Novice
loop code until the first empty row
 
Join Date: Mar 2017
Posts: 1
altina is on a distinguished road
Question loop code until the first empty row

Could you please help me write a loop code for this sequence?



I copy the table Y1:AT4 (containing information from the table A2:X8
I insert the information of consecutive rows:
Range("A4:V4").Select
Range("A5:V5").Select
Range("A6:V6").Select

Until the first empty row.
And I copy a value and paste it in the new table,

Thank you

here is the code:

Code:
Range("Y1:AT4").Select
    Selection.Copy
    Range("Y6").Select
    ActiveSheet.Paste
    Range("A4:V4").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("Y8").Select
    ActiveSheet.Paste
    Range("AT9").Select
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-5]C[-22]"
Range("Y1:AT4").Select
    Selection.Copy
    Range("Y11").Select
    ActiveSheet.Paste
    Range("A5:V5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("Y13").Select
    ActiveSheet.Paste
    Range("AT14").Select
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-9]C[-22]"
Range("Y1:AT4").Select
    Selection.Copy
    ActiveWindow.SmallScroll Down:=2
    Range("Y16").Select
    ActiveSheet.Paste
    Range("A6:V6").Select
    Application.CutCopyMode = False
    Selection.Copy
    ActiveWindow.SmallScroll Down:=3
    Range("Y18").Select
    ActiveSheet.Paste
    Range("AT19").Select
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-13]C[-22]"
    Range("AT20").Select
    ActiveWindow.SmallScroll Down:=-12

Last edited by macropod; 03-25-2017 at 12:27 AM. Reason: Added code tags
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating VBA Code to Delete Empty Column in Table Faugs Word VBA 5 08-07-2014 03:29 PM
How do you loop through an array with some empty values? omahadivision Excel Programming 5 11-28-2013 10:49 AM
loop code until the first empty row How to a For loop in VBA Jennifer Murphy Word VBA 1 01-29-2013 03:30 AM
Apparently empty (blank) cells aren't empty daymaker Excel 3 03-08-2012 03:41 PM
loop code until the first empty row Continuous Loop cksm4 Word 6 01-06-2011 09:03 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft