Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Selecting Cells With Visual Basic or Macro Code

Hello,

Imagine random numbers in cells between a1 and d5.

In cell a7 you could type a number , like 3
And in cell a8 you could type a number, like 4

What is the macro (or VB) code to return a value in b8 which is the random
number found in row 3, column 4, i.e. d3?

I know the excel formula, but not the VB.

Many thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Selecting Cells With Visual Basic or Macro Code

One way:

MsgBox ActiveSheet.Cells(3, 4).Value

In article ,
RajenRajput1 wrote:

Hello,

Imagine random numbers in cells between a1 and d5.

In cell a7 you could type a number , like 3
And in cell a8 you could type a number, like 4

What is the macro (or VB) code to return a value in b8 which is the random
number found in row 3, column 4, i.e. d3?

I know the excel formula, but not the VB.

Many thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Selecting Cells With Visual Basic or Macro Code

Thats well good !!

I changed it to a user defined function

Thanks

I'm really happy now !

"JE McGimpsey" wrote:

One way:

MsgBox ActiveSheet.Cells(3, 4).Value

In article ,
RajenRajput1 wrote:

Hello,

Imagine random numbers in cells between a1 and d5.

In cell a7 you could type a number , like 3
And in cell a8 you could type a number, like 4

What is the macro (or VB) code to return a value in b8 which is the random
number found in row 3, column 4, i.e. d3?

I know the excel formula, but not the VB.

Many thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Selecting Cells With Visual Basic or Macro Code

.... On second thought

Although its great, i'm half way there ...

How do I get the value to display in another cell on the sheet ?

If that statement is confusing, its clearer in my original question ..!

Many thanks



"RajenRajput1" wrote:

Thats well good !!

I changed it to a user defined function

Thanks

I'm really happy now !

"JE McGimpsey" wrote:

One way:

MsgBox ActiveSheet.Cells(3, 4).Value

In article ,
RajenRajput1 wrote:

Hello,

Imagine random numbers in cells between a1 and d5.

In cell a7 you could type a number , like 3
And in cell a8 you could type a number, like 4

What is the macro (or VB) code to return a value in b8 which is the random
number found in row 3, column 4, i.e. d3?

I know the excel formula, but not the VB.

Many thanks


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Selecting Cells With Visual Basic or Macro Code

Perhaps:

With ActiveSheet
.Cells(5, 10).Value = .Cells(3, 4).Value
End With


In article ,
RajenRajput1 wrote:

... On second thought

Although its great, i'm half way there ...

How do I get the value to display in another cell on the sheet ?

If that statement is confusing, its clearer in my original question ..!

Many thanks



"RajenRajput1" wrote:

Thats well good !!

I changed it to a user defined function

Thanks

I'm really happy now !

"JE McGimpsey" wrote:

One way:

MsgBox ActiveSheet.Cells(3, 4).Value

In article ,
RajenRajput1 wrote:

Hello,

Imagine random numbers in cells between a1 and d5.

In cell a7 you could type a number , like 3
And in cell a8 you could type a number, like 4

What is the macro (or VB) code to return a value in b8 which is the
random
number found in row 3, column 4, i.e. d3?

I know the excel formula, but not the VB.

Many thanks



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Selecting Cells With Visual Basic or Macro Code

That sounds really cool

I'm gonna try it over the weekend - its 6pm on Friday now - I'm leaving the
office

But it looks good, so i'm sure i can play around with it !!!

ThaNKs !!

"JE McGimpsey" wrote:

Perhaps:

With ActiveSheet
.Cells(5, 10).Value = .Cells(3, 4).Value
End With


In article ,
RajenRajput1 wrote:

... On second thought

Although its great, i'm half way there ...

How do I get the value to display in another cell on the sheet ?

If that statement is confusing, its clearer in my original question ..!

Many thanks



"RajenRajput1" wrote:

Thats well good !!

I changed it to a user defined function

Thanks

I'm really happy now !

"JE McGimpsey" wrote:

One way:

MsgBox ActiveSheet.Cells(3, 4).Value

In article ,
RajenRajput1 wrote:

Hello,

Imagine random numbers in cells between a1 and d5.

In cell a7 you could type a number , like 3
And in cell a8 you could type a number, like 4

What is the macro (or VB) code to return a value in b8 which is the
random
number found in row 3, column 4, i.e. d3?

I know the excel formula, but not the VB.

Many thanks


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
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
I don't want to run visual basic editer code after saving... areddy Excel Discussion (Misc queries) 1 October 26th 05 01:57 PM
How do I protect Visual Basic for Application Code Zagrijs Venter New Users to Excel 6 August 5th 05 09:24 PM
Visual Basic code available for all open workbooks KristiB Excel Worksheet Functions 5 May 6th 05 08:46 PM
Visual Basic Code Remains in "memory" Paul Moles Excel Worksheet Functions 1 December 10th 04 10:29 PM


All times are GMT +1. The time now is 03:56 PM.

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"