LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default copy and insert hidden row

I have the gotten the following VBA from previous post to insert and new line
- works great, but I want to be able to hide row (i) so people cannot insert
data into it. Is this possible? Thanks heaps in anticipation.

Public Sub ProcessData()
Const TEST_COLUMN As String = "a"
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

Application.ScreenUpdating = False
iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 1 Step -1
If .Cells(i, TEST_COLUMN).Value = "add" Then
.Rows(i).Copy
.Rows(i + 1).Insert
.Cells(i + 1, "a").Delete
.Cells(i + 1, "b").Select
End If
Next i
End With

End Sub
 
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 and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
copy/paste with hidden rows don't want hidden parts to paste robynne Excel Discussion (Misc queries) 1 September 21st 07 09:23 PM
Copy subtotals without hidden rows bfordmelson Excel Worksheet Functions 2 December 13th 05 08:11 PM
Copy without Hidden Cols - How abrogard Excel Discussion (Misc queries) 1 July 15th 05 07:54 AM
copy only non hidden cells Podgy Excel Worksheet Functions 1 December 8th 04 02:08 PM


All times are GMT +1. The time now is 03:42 AM.

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"