Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Creating Macro/Formula

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Creating Macro/Formula

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Creating Macro/Formula

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
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
Creating formula or macro Vecah Excel Worksheet Functions 0 November 5th 08 03:19 PM
Help creating Formula (or macro) bman342 Excel Discussion (Misc queries) 3 April 9th 06 06:13 PM
Creating a macro to apply a formula to particular rows smurray444[_8_] Excel Programming 1 February 5th 06 03:20 PM
Help with a macro creating a formula for a pivot table Valeria Excel Programming 1 November 20th 04 12:40 AM
Help creating a Macro or Formula [email protected] Excel Programming 1 August 12th 04 03:16 AM


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"