Help Creating A Macro

Kristi6178

New Member
Joined
Dec 31, 2015
Messages
6
First let me say, I know very little about macros. I have a few personal macros that I use which I found online over the years, but other than doing minor changes to them I have just copied them from other sources and assigned a shortcut to them to run. I don't know how to actually create one from scratch myself. So I really need help since the person I spoke with in my IT department said that a macro could do what I need, but she was unable to help since she doesn't have a lot of experience with them.

Here is basically what I am trying to do....I have a list of values in Column B, I would like to make it so that if you click a certain cell in column B it would move my cursor and enter a specific value into F2. e.g.
B3:B8=

<tbody>
</tbody>
10ft x 5ft - $1,255
10ft x 6.4ft - $1,325
12ft x 5ft - $1,325
12ft x 6.4ft - $1,395
14ft x 5 ft - $1,425
14ft x 6.4ft - $1,495

If I click on B3, I want it to enter $1,255 into F2. If I click on B4, I want it to enter $1,325 into F2. etc. I have over 50 values in column B to choose from. If someone can write a basic macro, I know enough to edit the macro and change the source cell and the value. Also, would I need a separate macro for each B value, or can they all be put into a single macro?

I initially thought I could create a hyperlink from B3 to send my cursor to F2 and then enter an assigned value automatically to the cell, but I've been told hyperlinks don't work that way. So I think a macro is my only option unless someone has other ideas.

As for other information you may need to do a macro....the filename is Trailers.xlsm, the sheet name is Trailer. I'm not sure if you need any other information from me. If anyone can help it would be greatly appreciated.
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,944
Office Version
365
Platform
Windows
How about
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
   If Not Intersect(Target, Range("B3:B50")) Is Nothing Then
      Range("F2").Value = Target.Offset(, 1).Value
      Cancel = True
   End If
End Sub
This needs to go in the relevant sheet module & works when you double click in rangeB3:B50
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,944
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,102,844
Messages
5,489,221
Members
407,681
Latest member
HoneyBadger914

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top