Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old January 5th 17, 08:52 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jan 2017
Posts: 8
Default Copy Row Above, with a Twist Q

I have several Blank rows above each is a row of data (covering columns A-D), what I want to do is populate each blank row with the following:-

Col A - Copy the Text from Row Above
Col B - Insert fixed Text "ABC"
Col C - I wish to remain blank
Col D - Copy the value that is in Col C in Row above to this column

Do above until last Row in sheet (as sheet can have a variable length)

Basically above are Debit and Credit lines,

  #3   Report Post  
Old January 5th 17, 09:35 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jan 2017
Posts: 8
Default Copy Row Above, with a Twist Q

Claus, works perfect, one slight update I need,

Re Col D - if Col C is blank i.e. has no value (in the row above), then what the Value is in Col D should be copied to Col C, if Col C is not blank, then your original code

As mentioned, these are Debit & Credits, so in first post I assumed all my data rows were debits i.e. had a value in Col C

  #5   Report Post  
Old January 5th 17, 10:04 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jan 2017
Posts: 8
Default Copy Row Above, with a Twist Q

Claus, thats it, works exactly how I want, one small thing, the very last row of Data doesn't copy down, so the code stops at the last row, but that last row needs to be copied down, then stop

I'm assuming this line needs adjustment LRow = .Cells(.Rows.Count, 1).End(xlUp).Row?



  #6   Report Post  
Old January 5th 17, 10:07 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2011
Posts: 3,535
Default Copy Row Above, with a Twist Q

Hi,

Am Thu, 5 Jan 2017 01:04:02 -0800 (PST) schrieb :

Claus, thats it, works exactly how I want, one small thing, the very last row of Data doesn't copy down, so the code stops at the last row, but that last row needs to be copied down, then stop


change that row
Set myRng = .Range("A2:A" & LRow)
to
Set myRng = .Range("A2:A" & LRow + 1)

Regards
Claus B.
--
Windows10
Office 2016
  #7   Report Post  
Old January 5th 17, 10:14 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jan 2017
Posts: 8
Default Copy Row Above, with a Twist Q

Claus, that didn't do anything, still last row hasn't copied

  #9   Report Post  
Old January 5th 17, 11:04 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jan 2017
Posts: 8
Default Copy Row Above, with a Twist Q

Bingo Claus, thats it. Many thanks




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
Copy many sheets into one twist Andy Excel Discussion (Misc queries) 2 March 6th 09 02:42 AM
If but with a twist:( AVB Over My Head New Users to Excel 3 September 16th 08 04:43 AM
Sum with a twist andrew Excel Discussion (Misc queries) 15 June 18th 08 08:56 AM
Copy A Worksheet, with a Twist John[_110_] Excel Programming 10 October 28th 05 04:59 PM
Copy a Formula down with a Twist Q John Excel Worksheet Functions 7 November 23rd 04 11:03 PM


All times are GMT +1. The time now is 10:42 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017