LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Re-post VBA into Formula

Hi


Through the discussion group I got an answer to a question but it turns out
I can't use VBA. Can it be done through the use of formulas? Here is the
VBA that I have:


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_Exit:

If Target.Address < "$A$1" Then Exit Sub
Application.EnableEvents = False

With Application
icol = .Match(Range("h1"), Range("3:3"), 0) '<=== change h1 if required
irow = .Match(Range("h2"), Range("C:C"), 0) '<=== change h2 if required
End With
Cells(irow, icol) = Range("a1")
ws_Exit:
Application.EnableEvents = True
End Sub
--

"Toppers" wrote:

The answer is no as the result of a formula is always in the cell in which
formula resides i.e. a formula cannot put an answer in another cell. A
formula in C1 cannot place a result in say F1.

The address of the "result" cell in your case is the unknown - hence the
"row,col" serach (MATCH) values in h1 & h2.

Perhaps if you explained the problem in another way, there may be an
alternative formula solution. But if it is a case of placing a number N in a
"random" cell then I believe VBA is the only way.


Hi.

I have a crazy idea. Would it be possible to put a formula in all of
the remaining cells in the worksheet that could be populated with the data
from A1?

The formula would cause each cell to look for it's coordinates in h1 and
h2. If it is found it it would enter the data from A1 into it's cell.

As an example I have placed question marks into some of the cells that
would contain this formula.




A B C D E F G H
1 N Row
2 Column
3 4 32 34 42 11 15
4 8 ? ? ? ? ?
5 1 ? ? ? ? ?
6 2 ? ? ? ? ?
7 9 ? ? ? ? ?
8 3 ? ? ? ? ?


Thanks much,
--
vze2mss6


"joesf16" wrote:


vze2mss6


--
vze2mss6
 
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
My first post - Please Help (Formula for adding Values) leapyleigh Excel Discussion (Misc queries) 14 July 13th 06 03:11 PM
Formula Help - Not Sure Where to Post tompal Excel Discussion (Misc queries) 4 January 12th 06 09:47 PM
Should I generally request "post a poll" when I post a new thread? Joe Miller Excel Discussion (Misc queries) 2 January 7th 06 04:46 PM
post code on col1 & list of suburbs in col2 - what is the formula varun Excel Discussion (Misc queries) 5 June 2nd 05 05:47 AM
Formula to post data in another spreadsheet taxmom Excel Worksheet Functions 5 March 17th 05 01:02 AM


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