Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2018, 03:15 PM
Mohd_KB Mohd_KB is offline Referencing using a variable Mac OS X Referencing using a variable Office 2011 for Mac
Novice
Referencing using a variable
 
Join Date: Mar 2018
Posts: 1
Mohd_KB is on a distinguished road
Default Referencing using a variable

Please note that I am a beginner user of Excel, so please excuse me if i use the wrong terminology.



Im writing a macro which will ask the user to enter the desired raw number, then "in the already selected cell" it will calculate the average of a range that starts from the 4th row of the conlomn of the active cell to the entered row number by the user.

Example:
active cell is B1, the macro will first ask the user for the desired row number (ex. 250), then the macro will calculate in B1 the average of B4:B250

This is my failed attempt

Code:
 
Sub Macro4() 
Dim Value05 As String 
Value05 = InputBox("when will it reach 0.5?") 
​​​​​​​ActiveCell.FormulaR1C1 = "=AVERAGE(B4:B(Value05))" *
End Sub
*

Thanks in advance
Reply With Quote
  #2  
Old 03-02-2018, 12:41 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Referencing using a variable Windows 7 64bit Referencing using a variable Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Hi and welcome
Please,do not crosspost your question on multiple forums without including links here to the other threads on other forums.

Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

Do not post any further responses in this thread until a link has been provided to these cross posts.
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to create a bar chart of multiple variable. Then I need to draw trend lin of those variable shimulsiddiquee Excel 1 05-16-2017 07:39 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Referencing using a variable Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
Referencing using a variable object variable or with block variable not set MJP143 Excel 1 02-11-2013 05:07 AM
Referencing using a variable Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft