LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #22   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Newbie attempting VBA Scripting

Sub Test1()

Set Marco = Rows(1).Find(what:="Marco", LookIn:=xlValues)
If Not Marco Is Nothing Then
myaddress = mid(Marco.address,2)
mycol = left(myaddress,instr(myaddress,"$") - 1)
ActiveSheet.Range("B3") = mycol
End If

End Sub


" wrote:

Joel,

I like method 2 the best since it searches for the exact name of the
column and adjusts its stuff from there. I wrote a quick script which
uses your method, but when it finds the column location, it is stored
as a number, instead of a letter. Is there a way to change that
within the function, or will i have to adjust the rest of my previous
macro to work with R1C1 naming?

Here is my test macro:

Sub Test1()

Set Marco = Rows(1).Find(what:="Marco", LookIn:=xlValues)
If Not Marco Is Nothing Then
mycol = Marco.Column

ActiveSheet.Range("B3") = mycol
End If

End Sub


Obviously this just returns the location of "Marco" into column B3, in
my example Marco was in Column I, which returned a 9.
How do i get it to return a column Letter instead? So i can easily use
this with my previous macro, which is based on the "A1" cell naming
convention.

Thanks again Joel.

-Pogster

 
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
Attempting to weight japc90 Excel Discussion (Misc queries) 2 July 28th 08 11:58 AM
Attempting to use VBA to Ping within Excel... Andy Dawkins Excel Programming 6 October 22nd 07 08:42 PM
Attempting to reduce userforms VB Newbie[_2_] Excel Programming 9 November 30th 05 01:45 AM
Attempting Excel Template jlr New Users to Excel 3 May 15th 05 09:45 PM
Newbie VBE scripting question jeff Excel Programming 1 December 20th 04 09:28 PM


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