LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Macro to copy cell contents number of columns

"Tom Ogilvy" wrote in message ...
Sub CreatedIndentedBOM()
Dim rng As Range, cell As Range
Set rng = Range(Cells(3, 5), Cells(Rows.Count, 3).End(xlUp))
For Each cell In rng
If Not IsEmpty(cell) And cell.Offset(0, -1) 0 Then
If isnumeric(cell.offset(0,-1)) then
cell.Offset(0, clng(cell.Offset(0, -1).Value)).Value = cell.Value
End if
End If
Next
End Sub

Perhaps.

You are looping though

C3:E20 if 20 is the last row occupied in column C as an example

Is that what you want?

--
Regards,
Tom Ogilvy

<snip


Tom, it works perfectly. You are a God!

PC
Thanks again.
 
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 contents from one cell to another Don[_4_] New Users to Excel 0 September 25th 09 04:18 PM
how to copy the contents from last cell Lamb Chop Excel Discussion (Misc queries) 2 January 17th 08 01:27 AM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Using VB copy contents of a macro to workbook jminu_2k Excel Programming 2 September 7th 04 10:11 AM
Copy cell contents into Macro code Bob Leonard Excel Programming 2 December 1st 03 07:29 PM


All times are GMT +1. The time now is 04:28 PM.

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"