LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Getting Error in Micro(for Loop)

I am trying to add extra rows and the merge certatin columns together, but I
am getting a

Run-Time error '1004'
Application-defined or object-defined error

How come?

Here is the code:
Sub AddExtraRows()

ActiveSheet.Unprotect Password:="eli"
Rows("32:80").Insert Shift:=xlDown

For i = 32 To 103
Range(Cells(i, 3), Cells(i, 6)).Merge
Next i

For j = 32 To 103
Range(Cells(j, 7), Cells(j, 12)).Merge
Next j

For k = 32 To 103
Range(Cells(k, 13), Cells(k, 15)).Merge
Next k

With ActiveSheet
.Protect Password:="eli"
.EnableSelection = xlUnlockedCells
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
Micro Ganesh Kumar Excel Worksheet Functions 2 July 21st 09 03:54 PM
Micro roheel Excel Programming 0 April 26th 05 09:43 AM
Micro djmimi Excel Worksheet Functions 0 February 9th 05 05:29 PM
what does the micro do Ibrahim New Users to Excel 1 December 8th 04 01:54 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM


All times are GMT +1. The time now is 06:19 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"