PC Review


Reply
Thread Tools Rate Thread

Creating Macro/Formula

 
 
=?Utf-8?B?RGlhbmE=?=
Guest
Posts: n/a
 
      20th Feb 2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      20th Feb 2007
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

--
Gary''s Student
gsnu200707


"Diana" wrote:

> 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

 
Reply With Quote
 
=?Utf-8?B?TWF4?=
Guest
Posts: n/a
 
      20th Feb 2007
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
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Diana" wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for creating a formula daverunt Microsoft Excel Programming 1 2nd Jun 2009 08:53 AM
Creating formula or macro Vecah Microsoft Excel Worksheet Functions 0 5th Nov 2008 03:19 PM
Creating a formula in Macro Govind Microsoft Excel Programming 2 9th Sep 2008 05:01 PM
Help creating Formula (or macro) =?Utf-8?B?Ym1hbjM0Mg==?= Microsoft Excel Misc 3 9th Apr 2006 06:13 PM
Help creating a Macro or Formula lhernan1219@hotmail.com Microsoft Excel Programming 1 12th Aug 2004 03:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 PM.