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 Convert code rows to columns


Hi,
This code was posted by Norman Jones i believe. It works great.

Code
-------------------
Sub test()
Cells(LastRow(ActiveSheet) + 1, "A").Value = "Hi this is one row below the Last Used Row"
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Functio
-------------------

I tried to change it for Columns instead of Rows. what am i doin
wrong?

Code
-------------------
Sub test()
Cells(LastCol(ActiveSheet) + 1, "A").Value = "Hi this is one column past the Last Used Column"
End Sub

Function LastCol(SH As Worksheet)
On Error Resume Next
LastColumn = SH.Cells.Find(What:="*", _
After:=SH.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
On Error GoTo 0
End Functio
-------------------

Dav

--
Piranh
-----------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2043
View this thread: http://www.excelforum.com/showthread.php?threadid=47568

 
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
Convert Columns to Rows Chris Bode via OfficeKB.com Excel Discussion (Misc queries) 0 February 8th 09 07:10 AM
Convert Columns to Rows Dave Peterson Excel Discussion (Misc queries) 0 February 8th 09 01:56 AM
convert columns to rows DHM Excel Worksheet Functions 4 June 30th 07 02:52 AM
Convert rows to columns lucrezia Excel Worksheet Functions 0 June 28th 07 06:36 PM
to convert columns to rows having mulit independent group columns Quacy Excel Worksheet Functions 1 August 22nd 06 11:20 PM


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