Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Creating Macro/Formula

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Diana - 20 Feb 2007 17:28 GMT
I have a table such as the one below, I would like to create a formula/macro
that will give my worksheet a comand to replace the text values on the left
with the numbers to their right. Is that possible??

ir    660
250   
350   
700   
ar    987
320   
710   

Your help is very much appreciated
Gary''s Student - 20 Feb 2007 18:09 GMT
Try something like:

Sub diane()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To lastrow
   If Application.WorksheetFunction.IsNumber(Cells(i, 1).Value) Then
   Else
       Cells(i, 1).Value = Cells(i, 2).Value
   End If
Next
End Sub

Signature

Gary''s Student
gsnu200707

> I have a table such as the one below, I would like to create a formula/macro
> that will give my worksheet a comand to replace the text values on the left
[quoted text clipped - 9 lines]
>
> Your help is very much appreciated
Max - 20 Feb 2007 18:14 GMT
One formulas way ..
Assuming source data in cols A and B, from row1 down
In C1: =IF(A1="","",IF(ISTEXT(A1),B1,A1))
Copy C1 down, then copy col C & do a paste special as values to overwrite
col A. Clean up by deleting cols B and C
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

> I have a table such as the one below, I would like to create a formula/macro
> that will give my worksheet a comand to replace the text values on the left
[quoted text clipped - 9 lines]
>
> Your help is very much appreciated
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.