- Public col, nmb, x, y, z As Variant
-
Public hw(17) As Variant
-
Public buses(17, 200), sht, dt, nme, per, rnk As String
-
'
-
'
-
'
-
' Function Makelist
-
' Updated by DEE 5/10/1999
-
'
-
Sub Makelist()
-
sht = ActiveSheet.Name
-
col = 1
-
msg = "Would you like to print individual Regions for " + Format(sht, "mmmm yyyy") + "?"
-
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
-
Title = "What is your bidding, master?"
-
response = MsgBox(msg, Style, Title)
-
If response = vbCancel Then End
-
If response = vbYes Then
-
dist = InputBox(Title:="Single Region Printing", prompt:="Which Region?", default:="1")
-
If dist = "" Or Val(dist) > 4 Then End
-
z = Val(dist)
-
all = False
-
Else
-
all = True
-
End If
-
-
whosename
-
-
Sheets(Format(sht, "mmmm yyyy")).Select
-
If Not all Then
-
z = Val(dist)
-
Gather
-
ElseIf all Then
-
For z = 1 To 4
-
Gather
-
Next z
-
End If
-
'
-
' Clear Details
8 1747 - Dim NumberLetters(4) as String = {"", "N", "W", "E", "S"}
-
Region = InputBox()
-
Return NumberLetters(Cint(Region))
You'll need to do some error checking of course...
tlhintoq 3,525
Recognized Expert Specialist TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out. tlhintoq 3,525
Recognized Expert Specialist
Mate, it would really help if you could describe your need/question.
The little bit that fits in the title doesn't give us the big picture of what you are trying to accomplish
My apologies, but I am not literate in VBA code etc. I have "inherited" an Excel program written some years ago that designs a "roster" and gather information from another spreadsheet and then produces a report from that roster.
Now they have changed the way the "label" the locations from, for example
1MW to NMW or 2AN to WAN. So now I need to understand how to change the numerical reference to an alpha reference and still produce the same reports, hopefully without resorting having to have someone re-write the whole thing.
How / where would I insert the response from !NoItAll?
Into this.
Mick's Stuff
' Macro Updated on 5/10/1999 by DEE
'
'
'
'
' Declarations - Public col, nmb, x, y, z As Variant
-
Public hw(17) As Variant
-
Public buses(17, 200), sht, dt, nme, per, rnk As String
-
'
-
'
-
'
-
' Function Makelist
-
' Updated by DEE 5/10/1999
-
'
-
Sub Makelist()
-
sht = ActiveSheet.Name
-
col = 1
-
msg = "Would you like to print individual Regions for " + Format(sht, "mmmm yyyy") + "?"
-
Style = vbYesNoCancel + vbQuestion + vbDefaultButton1
-
Title = "What is your bidding, master?"
-
response = MsgBox(msg, Style, Title)
-
If response = vbCancel Then End
-
If response = vbYes Then
-
dist = InputBox(Title:="Single Region Printing", prompt:="Which Region?", default:="1")
-
If dist = "" Or Val(dist) > 4 Then End
-
z = Val(dist)
-
all = False
-
Else
-
all = True
-
End If
-
-
whosename
-
-
Sheets(Format(sht, "mmmm yyyy")).Select
-
If Not all Then
-
z = Val(dist)
-
Gather
-
ElseIf all Then
-
For z = 1 To 4
-
Gather
-
Next z
-
End If
I'm happy to forward the whole file if someone can point me in the right direction.
tlhintoq 3,525
Recognized Expert Specialist
1MW to NMW or 2AN to WAN.
So the codes are already 1MW, 2AN etc.?
So you aren't just inserting a letter, but you need to actually read the existing code and change it based on the first letter of the code.
Is that right?
tlhintoq 3,525
Recognized Expert Specialist
1MW to NMW or 2AN to WAN.
So the codes are already 1MW, 2AN etc.?
So you aren't just inserting a letter, but you need to actually read the existing code and change it based on the first letter of the code.
Is that right?
tlhintoq 3,525
Recognized Expert Specialist
How / where would I insert the response from !NoItAll?
!NoItAll is suggesting that you create an array of letters that corresponds to your numbering
- Dim NumberLetters(4) as String = {"", "N", "W", "E", "S"}
Element 1 is "N"
Element 2 is "W" and so on
This way you can match (or rebuild) your code "2an" to "Wan" by just taking the first character of the code, convert it to number and grab that element of the array.
"2" as a string becomes the int of 2.
NumberLetters[2] is "W"
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: PhilC |
last post by:
Hi Folks,
If I have an array holding a pair of numbers, and that pairing is
unique, is there a way that I can find the array index number for that
pair?
Thanks,
PhilC
|
by: taras |
last post by:
IE 6.0 sockets number (TCP/IP channels number) for the same Site ???
I've discovered the restriction: IE 6.0 has 2 sockets only to the same
Server (ASP.NET Site).
Where can I find any kind of information about this limitation?
P.S.
IE 6.0 from Windows 2003 Server has the same limitation,
but if the sockets number is increased to 3, then IE stuck (with Done
status) till Refresh.
|
by: mikeybe |
last post by:
Anyone know how to return the disk number (i.e. the number you see
when you launch windows disk manager and see your drives numbered disk
0, disk 1, etc.)? I'm not talking about the volume serial number or
drive serial number. For example, I want to programatically determine
what disk number the c drive is using vb.net and windows 2000.
Thanks,
Mike Beccaria
|
by: tojigneshshah |
last post by:
Hi,
I have a situation where i have multiple batch and the each batch are
sequence numbers. For each batch, the number should start with 1.
For example:
Col.no1 Col.no2
------ -------
batch1 1
batch1 2
|
by: petermichaux |
last post by:
Hi,
Is there an internally assigned number for each JavaScript object that
I can read? If so how would I do that?
Thanks,
Peter
| |
by: rhepsi |
last post by:
Hii all,
I have a project where before i upload the data from 1st database to 2nd database, im truncating the 2nd database and then trying to upload...
In this process, wat i found was that: My records in the database are something like:
`tbl_workers` (`wo_worker_id_pk` bigint(11) unsigned NOT NULL auto_increment,
`wo_worker_code` varchar(6) NOT NULL default '',
`wo_worker_catagory` varchar(50) default NULL,
|
by: Visame |
last post by:
ofstream out1, out2;
out1 = out2; // error: cannot assign stream objects
// print function: parameter is copied
ofstream print(ofstream);
out2 = print(out2); // error: cannot copy stream objects
Why there is NO Copy or Assign for IO Objects? Can anyone tell me the reason? Thanks!
|
by: sheperson |
last post by:
Hi,
I have been working for several months on a sofware and now it is
finished.
I have a problem now and it is this:
Because I live in a country which there is no copyright law in it
(Iran!!!!). As soon as I give the software to some customers, the
software will be copied illegally and I don't want this happen.
Now I wonder if anyone could help me on how to create a lock or a
serial number for the software.
I want my software to...
|
by: chandru8 |
last post by:
hi every body
i need a logic , that
for a particular code i need to genrate a serial number for a day should be one
for the next day it should be increment to 2 like this
can any one help me in this
Please..,
its urgent
thanks a lot
|
by: davidson1 |
last post by:
Hai friends....
In C
for 97=A character , 65=a charcter....can u tell what is the number for "space" character...
Davidson
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |