I have a sizable spreadsheet, which has one column where the cells are mostly numeric strings of up to 6 numbers - there are variations, which I will mention.
What I need to do, is to treat the numbers as individual figures, and add them, then divide by the number of figures. e.g. cell value '123456' I need to process as (1+2+3+4+5+6)/6.
The variations are that '0' has to be added as 10, and any letters need to be added as 12. '-' and '/' which are the only non-alphanumeric values should be ignored.
I need to be able to take someones name which is in a single cell in the format "First Middle Last" (could be more than one middle name) and then split it up so that it fits the following format:
Last name (must be 50 characters) Middle name (must be 15 characters) First Name (must be 15 characters)
I'm unsure on the right combination of operators to use to variably concatenate strings in this way. I'm confident I can figure out how to add the white spaces after a name to make it fit the character requirement but I don't know how to split the initial name up into it's 3 parts. Names longer than the character requirement will just be truncated.
I have a macro that loops through a column of text and removes all text after a hyphen. Example: AU9929-PK becomes AU9929. I need to set up some exceptions that when it processes certain text it does not truncate it. Example: AU9929-ASST stays as AU9929-ASST. So far there are twelve exceptions but this could increase.
Note: The list which includes shop number, description, sku, sku description, quantity, unit price and more is sorted in a particular order as other operations are performed on it that requires it be in a specific order.
I am trying to let the user call my subroutine in the following 5 ways but am lost using string manipulation -
Call FindReplaceAll(C, 123, 1.23) In Col C replace 123 with 1.23 Call FindReplaceAll(2, 123, 1.23) In Row 2 replace 123 with 1.23
Call FindReplaceAll(C:E, 123, 1.23) In Col C-E replace 123 with 1.23 Call FindReplaceAll(2:4, 123, 1.23) In Rows 2-4 replace 123 with 1.23
Call FindReplaceAll(C9:E19, 123, 1.23) In region C9-E9 replace 123 with 1.23
Here is what I am trying to do in psudo Sub FindReplaceAll(sType As String, sFind As String, sReplace As String) If sType does not have a colon in it then If sType = A-IV or sType = a-iv only then Columns(sType &:& sType).Select If sType = 1-65000 then Rows(sType &:& sType).Select Else
i have a worksheet called 'week 1' and want to write vba code so that a new sheet called 'week 2' can be created. However i want to write code so that it doesn't matter what sheet i am on, a new sheet would be created with the name week and the next number up. ie. the last worksheet is 'week 7' then the code should be able to create a new worksheet called 'week 8' ect. I currently have this code but it keeps returning an error message. anyone know how i could do this???
Sub nSheet() Dim nm, i As Long nm = Worksheets(Worksheets.Count).name i = 1 Sheets.Add Do While WorksheetExists(Left(nm, Len(nm) - 1) & i) i = i + 1 Loop ActiveSheet.name = Left(nm, Len(nm) - 1) & i End Sub
I am trying to do is extract the volume size of products in 'ml' from 10k plus products from a description field cell. this description field could also contain the weight of the product in grams so I cannot just do a search for a numeric string , it has to be associated with the milli-litres statement .
is is possible to do a sort of ' *ml ' search and then select and copy to another cell ???
I am trying to slim down my database results in Excel via MS Query by searching for Part ID's that are numeric (we have parts that also contain letters....I want to weed those out).
In all my searching on the web, I thought the ISNUMERIC() function should be the function for this, but I keep getting an ORA-00904::"ISNUMERIC":invalid identifier....
Is this function supposed to work or is there another function that will do this
This is my SQL statement so far, which works to get parts that are 6 characters long only:
SELECT PART.ID FROM SYSADM.PART PART WHERE (LENGTH(PART.ID)=6) When I change it to this to get parts that are numeric, it gives the error above:
SELECT PART.ID FROM SYSADM.PART PART WHERE (LENGTH(PART.ID)=6) AND (ISNUMERIC(PART.ID)=1)
Given 5 rows in column A, I have strings that has the word 'Qty' and some none. For any string that has the word 'Qty', I want the numeric value before it. For string that doesn't have the word 'Qty', I want it to be 1. My question is, how should I added the numeric string without a helper column?
Column A Desired Qty to Take
some string name and ended with (4 Qty) 4
some string name without the word Qty 1
[code]....
In the above example, I would like to have an answer in say cell B1 to be 15
IDMacro Out Put X11891189 cdecde CONFRCONFR 175175 D0101101
I ahve a sheet having two column one is "ID" and other is "Macro Out Put" as shown above , is that possible with VBA code that it give the same result as i shown above in column "Macro Out Put". for reference i also attch the file
It works if alphabetic and numbers are clustered together such as scs987 It works if alphabetic and numbers are not clustered together such as scs987dtg
Problem: It does not work when numbers are not clustered together such as scs987dtg1234
I need to be able to locate a date in a spreadsheet bassed uppon a user input date. I am looking for the week that contains the user's date. However it seems even if I initialize the value as Date, it still reads the user's input as a string.
Is there an easy way make sure the system automaticaly recognizes the user's input as a date, or is there a way to quicly convert the string to a date?
I'm trying to extract alphanumeric data before and after a numeric string. The numeric string is in the middle of a URL, which is a varying distance from the start and end.
Here's a sample of my data:
URL Page ID Headline Section quiz.impression-http://www.stuff.co.nz/2677193 2677193
I start with just column A and generate the other three from that.
I'm using some excellent code from a Mr Excel guru (thanks again Peter) to extract the 8-digit numeric string in column B, I just need C (after) and D (before).
That macro is: Dim Bits Dim c As Range Dim i As Long
For Each c In Range("A4", Range("A" & Rows.Count).End(xlUp))....................
I have some code where I need to check if the first five char are numbers and not letters.
I have in a column for example 12345-someone is here 23456-someone else is here someone is here too
I need to get all of the ones that have 5 digits and not pull in the other into a new list.
I have tried Left(CPHierAll. Cells(CPHierAllRow, 1),5) which will get me the fist 5 char. and then i need to check to make sure that they are all numbers and not char.
if Left(CPHierAll.Cells(CPHierAllRow, 1),5) = "#####" then But this does not bring anything in.
I also tried if CPHierAll.Cells(CPHierAllRow, 1),5) = "#####" then
I have 3 column that i am checking for different thinks the first two work just find and seperate out on the check but the last one with the numbers is being a pain.
I have created a macro that searches for an existing part in my worksheet and copies the found part to the row above. I would like to increment the value of cells B and H in the new copied row. Both cells contain an alphanumeric string that ends with a numeric value. For example cell B has a string like this "APL-DK0030" and cell H has a string like this "Dell Optiplex GX260 V09"....
Problem: String is broken into 2 parts within a delimeter. Goal: To keep each String/Segment intact regardless of Alpha/Numeric.
I have a .csv file with 26 segments (commas). This file contains customer data: PO#, Order#, Carton ID, Address 1, Address 2, Address 3, etc.
I've written code to capture all 26 segments as: Input #1, Seg1, Seg2, ... ,Seg26. The variables work fine until it encounter a string with Numeric first then Alpha within the same segment.
For this example we have a string such as (...,187 Main Street, PO Box 369,...) Seg4 = Address Seg5 = PO Box
The Segment Variables in Input #1, get shifted when it encounters the numeric portion of the address...so the result becomes: Segment4 = 187 Segment5 = Main Street Segment 6 = PO Box 369.
So on my next loop when ReadLine is executed...all the variables are shifted and I can't focus on the specific segment that I need to do something to it.
It delimits when it encounters Numeric then Alpha within the string, but accepts the entire string into the variable when its Alpha then Numeric within a delimeter.
How I can keep the entire string in tact within each delimeter?
Looking to extract a numeric value with two letters attached to it from text strings. The text strings vary. Below are the examples I'm looking to extract .51OZ from the first cell, 12CT from the second, and 30CT from the third.
BEANO AD A-G LIQ RS 0.51OZBEANO AD A-G TAB-CHW RS 12CTBEANO AD A-G TAB-CHW RS 30CT
My workbook has 9 queries, all needing the same string. I would like to have a msgbox pop up, let them enter the directory name, and have that change all the odbc conneciton strings automatically. Can anyone point me in the right direction?
The message box would be a nice touch, but is not necessary, I can change it in the VBA editor if needed.
Currently, they connect using a Visual FoxPro ODBC driver. We setup the connection when we made the queries. Now that they are in on the worksheets, I want to be able to edit them with VBA instead of using the script editor (which is very slow).