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: 1
Default Placing Workshet Name in cells


Hi,

I have 50 worksheets in a workbook,

For each, i need to:

1) Insert a Column at far left
2) For each cell in this Col I need to place the value of th
Worksheet Name

So if there are 127 used rows, and the Worksheet Name is 100100
A1:A127 need to all be populated with the value 100100

My code below doesn't quite work, any tweaking is much appreciated.

Many Thanks


Sub ins()
For Each wks In Worksheets

On Error Resume Next
Dim i
Dim LastRow As Long

Columns("A:A").Select
Selection.Insert Shift:=xlToRight
LastRow = Cells(Rows.Count, 2).End(xlUp).Row

For i = 1 To LastRow
Cells(i, 1) = Worksheet.Name
Next

End Su

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=46945

 
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
Sorting Cells on letters and numbers and placing result in one of 3 columns pano Excel Worksheet Functions 2 February 7th 07 03:46 AM
Extracting from 1 cell and placing extractions in multiple cells lkw441 Excel Programming 1 July 17th 05 05:58 PM
placing formula in cells Terry V Excel Programming 10 September 29th 04 03:26 PM
stripping string & placing into cells dabith[_4_] Excel Programming 2 June 13th 04 03:50 PM


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