Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default If B4 =? enter 1 in A4

Hi

What I would like to do is

Starting at B4, if B4 has a number in it enter 1 in column A row same as B
repeat to end of column B

Thanks in advance

Blue


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default If B4 =? enter 1 in A4

Hi
enter the following in A4
=IF(ISNUMBER(B4),B4,"")
and copy down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


Blue wrote:
Hi

What I would like to do is

Starting at B4, if B4 has a number in it enter 1 in column A row same
as B repeat to end of column B

Thanks in advance

Blue


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default If B4 =? enter 1 in A4

Thanks for the reply Frank

I want to do this in code so I can use it in various spreadsheet without
having to do it manually, ie Run macro ???? and it enters 1 in A if B=?

Thanks

Blue


"Frank Kabel" wrote in message
...
Hi
enter the following in A4
=IF(ISNUMBER(B4),B4,"")
and copy down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default If B4 =? enter 1 in A4

Hi
don't know why you want a macro for this but try something like the
following
Sub change_b()
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).row
For RowNdx = LastRow To 4 Step -1
with Cells(RowNdx, "B")
if isnumeric(.value) then
.offset(0,-1).value = .value
End If
end with
Next RowNdx
Application.ScreenUpdating = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Blue wrote:
Thanks for the reply Frank

I want to do this in code so I can use it in various spreadsheet
without having to do it manually, ie Run macro ???? and it enters 1
in A if B=?

Thanks

Blue


"Frank Kabel" wrote in message
...
Hi
enter the following in A4
=IF(ISNUMBER(B4),B4,"")
and copy down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default If B4 =? enter 1 in A4

Try this

Sub test()
Columns("B").SpecialCells(xlCellTypeConstants, _
xlNumbers).Offset(0, -1).Value = 1
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Blue" wrote in message ...
Thanks for the reply Frank

I want to do this in code so I can use it in various spreadsheet without
having to do it manually, ie Run macro ???? and it enters 1 in A if B=?

Thanks

Blue


"Frank Kabel" wrote in message
...
Hi
enter the following in A4
=IF(ISNUMBER(B4),B4,"")
and copy down for all rows

--
Regards
Frank Kabel
Frankfurt, Germany







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default If B4 =? enter 1 in A4

Frank and Ron thanks for the quick replies

Frank changed .offset(0,-1).value = .value to .offset(0,-1).value = 1
This gave the answer I wanted.

Ron your code worked great as well.

Thanks to you both

Blue


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
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
Enter multiple numbers in a cell so total shows when enter keypres newbie Excel Worksheet Functions 2 August 19th 07 12:23 PM
Enter info in one sheet, auto enter in another based on one field The BusyHighLighter[_2_] New Users to Excel 1 August 1st 07 10:54 PM
Auto enter date when data in enter in another cell Brian Excel Worksheet Functions 5 December 7th 06 06:44 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM


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