473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Excel VBA Code Help needed please - Still learning

Please help
I have a worksheet I update monthly using Microsoft query.
The information is collated and summarised in the attached worksheet.

I need a small VBA code Based on a command button to.
1. Request the Month/Year (APR-15)

Then using the user input copy the Total value from F9 and copy it to the Cell in D based on the matching month in C

This is a small step I know and can do it manually however once I have this working I will move forward. I am trying to teach myself VBA but am struggling here.

Thanks
Attached Files
File Type: xlsx Sample Data.xlsx (134.7 KB, 316 views)
Oct 4 '15 #1
1 2240
zmbd
5,501 Expert Mod 4TB
Charliebear:
1) You'll find that un-requested files are not usually downloaded by our moderators or experts for various reasons.
2) Requests for "final code" without showing your efforts are often ignored. (Please see the FAQ section)

SO, what to do?
If you have your code ({alt}{F11} will open the VBA editor) copy and paste it here, then select that pasted text and click on the [CODE/] formatting option in the toolbar.

Post a small example of your data
Use the [CODE/] formatting option in the toolbar to preserve the column formatting and spaces (not the tab key :) ) to space your columns.

Once we have that we can go from there.

Some tips:
Open any Office-word/excel/database>
<alt><F11> to open the VBA editor...
Menu>Tools>Options>
>Editor tab, UNCHECK "auto Syntax Check" you're vba code will still highlight if in error, just

no annoying message boxes while you type!
>CHECK the "Require Variable Declaration" option --- you will now have to use the

"DIM...variablename....typecaste" construct in your code. Highly advised.
Everything else on this tab check, I prefer the tab step to be either 2 or 4 spaces.
>The other tabs are good as is for most people, review if you want.
You may find this introductory tutorial site helpful:
www.homeandlearn.org>Excel VBA For Complete Beginners
PLEASE DO NOT DO THIS as suggested in the tutorial:
In order to run macros without any annoying security warnings, click on Macro Security, on the Code panel. Select the option for Enable all macros. Then make sure that "Trust access to the VBA object model" is checked:
Set the security to "Disable with Notification" - IMHO the "annoying security prompt" is better than opening some file from a friend or colleague that wipes out all of your hard work!



Thnx
-z
Oct 24 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Nikola | last post by:
Compiler prompts a dosen errors Proffessionals, HELP! I's not english, try anyway ... thanks #include<stdio.h> #include<stdlib.h> #include<string.h> struct osoba {
1
by: Shilpa | last post by:
Hi All, I need C# code needed to open the windows "Open with" dialog Regards, Shilpa
5
by: bromio | last post by:
can someone help me to make code for digital clock using AT89S52. The specs of clock are 12 hour clock,am-pm display,use timer interrupts to have delay.two external inputs to adjust hours and...
0
by: ultradiv | last post by:
I have a VB.NET application partly built that produces an xml output (just a file at present) I have a .NET webserver and SQLserver 2000 I need to be able to send the xml to the webserver/database...
1
by: dwareham | last post by:
I'm not a programmer so this is a stretch for me. What I need is a simple macro for Excel that copies the values in column F (F2:F200) to a different column in a different worksheet. Not sure if...
3
by: manigattani | last post by:
Please let me know of some java code for converting dbf file to text file
7
by: Bobh | last post by:
I am trying to figure out some code for a report issue; I have an employee who has a incentive scheme. I have a report showing various income amounts and in the report footer I vae totals for...
1
by: JC2710 | last post by:
Hi I have a problem which I cant quite solve. I have a query that groups records together to get a Total Price..... Group....... Total Quantity............Price ...
1
by: bill roberts | last post by:
i have the following code in my program: Dim cn As System.Data.OleDb.OleDbConnection Dim cmd As System.Data.OleDb.OleDbDataAdapter Dim ds As New System.Data.DataSet() cn = New...
2
by: paul138 | last post by:
Hi, I have created an index in Excel that goes up by 1 everytime a macro is run. (cell c99 in Sheet1) I.e. it starts at one, i run the macro and it now shows 2. I wish to add some code to my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.