It is simple. Add this function in your excel workbook.[tools->macro->vba
editor: insert->module]
Function rowNum(r As Range) As Integer
rowNum = r.Row
End Function
in any cell if you type =rowNum(c5) the result will be 5.
Akhilesh Kumar Karna
On Sat, Jul 18, 2009 at 6:22 AM, Adrian wrote:
I would be interested if there is simpler method to perform your task.
Meanwhile you can use the following function.
'
Function StrSubTotal(r As Range) As String
Dim i As Integer
i = 1
While r.Cells(i, 1).Height = 0
i = i + 1
Wend
If you call Addval from your CntCell subroutine, the value of Count will be
available in CntCell. That is, value of Count will be passed to Addval from
the original subroutine.
Akhilesh Kumar Karna
On Mon, Jul 13, 2009 at 12:37 PM, obahor o wrote:
> For instance
>
> Dim Count As Integer
> Sub
How about the following
=COUNTIF(A1:A8,A6) + COUNTIF(A1:A8,A7)
Akhilesh Kumar Karna
On Thu, Jul 9, 2009 at 4:35 PM, amresh kumar wrote:
> Hi Team,
>
> i want learn more of countif function.
>
> example
>
> City Delhi Mumbai Maharashtra
> Delhi Mumbai Delhi Mumbai =COUNTIF(
You need to change your code. It would be better you send your code, so that
a minor modification will be sufficient in stead of writing the whole code
for you.
Akhilesh Kumar Karna
On Thu, Jun 25, 2009 at 4:25 AM, Ankit Mehra wrote:
> Hello Group,
>
> First of all, Thanks a lot for showing yo
1. Creation of batch file
Sub Create_bat()
open "c:\path\to\file.bat" for output as #1 ' open the batch file
' Add print codes as required (to be printed to the batch file) e.g,
Print #1, "copy " & cells(1,1) & " abc.txt"
close #1 ' close the file
end sub
2. running the batch
You need to copy the data to excel. The format of your data is not correct.
Like, you will need to change 2.147.523 ---> 2147.523.
In excel it is very easy to plot the data.
Akhilesh Kumar Karna
On Fri, Jun 12, 2009 at 1:04 PM, jenny Hanson wrote:
> Dear member,
>
> I have a question . The qu
Replace the following line in your code
Worksheets("Input").Range("source_col:source_col").Copy _
Destination:=Worksheets("Output").Range("dest_col" & 1)
with
Worksheets("Input").Range(source_col & ":" & source_col).Copy _
Destination:=Worksheets("Output").Range(dest_col & 1)
Akhilesh Kumar Ka
was not able to get this to work. I have heard that PDF creator has
> hooks in it for this kind of thing, but I have not investigated that
> yet.
>
> On May 21, 11:05 am, Dustin wrote:
> > I'll try that out and get back to you.
> >
> > For this example, creati
>
> What I would like to do is to have only ONE print job sent to the
> printer, which will result in 11 pages. Does that help?
>
> Dustin
>
> On May 12, 2:10 am, Akhilesh Karna wrote:
> > Maybe I got it wrong. But if I understand
Maybe I got it wrong. But if I understand correctly, then you can use the
following code at the end of the loop ( when your data is being read to the
invoice).
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Hope you make your problem more clear if the above does not help.
Akhilesh Kumar Karn
'Change as necessary
End If
End Sub
Akhilesh Kumar Karna
On Fri, May 8, 2009 at 7:55 PM, Doug wrote:
>
> Thank you for the response.
>
> The problem with this code is that the macro run as soon as the cell
> is selected. I want the macro to wait until the user presses "Enter
The following code may be of help:
open excel
open visual basic editor
double click sheet1 (or any other sheet) under microsoft excel objects
Add the following code
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Range("C:C"), Target) Is Nothing Then
'do noth
You can use the following code (slightly changed from original).
Sub RedemptionsUSD()
Dim ModelCash As Worksheet
Dim CashFlow As Worksheet
Set ModelCash = Workbooks("Model.xls").Worksheets(1)
Set CashFlow = Workbooks("Model.xls").Worksheets(2)
Dim j As Integer
Dim c As Int
Hi,
You can find the solution in the attached file. Try putting the values in
input-range to see the effect.
Hope it helps.
Akhilesh Kumar Karna
On Tue, Apr 28, 2009 at 12:13 AM, Urrutia wrote:
>
> Hi all,
>
> I'm pretty new to this type of coding in vba.
> I'm trying to write a code that wor
Hi,
You may not be able to set different footer for each page in Excel (I may be
wrong). However, you can print out your document with the conditional
placing of footer using the following code.
'Start-
Sub setFooter(pageType As String)
'
If pageT
Hello,
It was nice to know that the code worked.
In the code, vlook is just a variant which will store the result of vlookup
function.
'on error resume next' causes the vba code to progress to the next line
whenever there is an error, without popping up any error message. So, it
needs to be used c
Change the first line of the code to -> Dim RowsMoved As Long [Integer ->
Long]
It will be better if you break the message inside the msgbox to make it
readable (sorry for unsolicited suggestion).
Regards,
Akhilesh Kumar Karna
On Thu, Feb 5, 2009 at 12:40 AM, TimoHubbard wrote:
>
> Can anyone
Hello,
You can improve the performance using the following code:
'---
Sub write_equal()
Sheets("sheet2").Select
Range("a2").Select
Dim nameArtist As String
Dim searchArea As Range
Dim vlook
Set searchArea = Sheets("sheet1").Range("a2:b100")
Do While
Let us not forward hoaxes. We can easily find whether a message is hoax.
Please refer below:
http://www.hoax-slayer.com/nirosha-silva-hoax.shtml
--~--~-~--~~~---~--~~
Visit the blog to download Excel tutorials at
http://www.excel-macros.blogspot.com
To post to t
Excel is not a text file. So you can not change a text file to an excel file
by simply changing extension or by replacing comma with other characters.
You may try to open an excel (.xls) file with a text editor to see its
format.
Akhilesh Kumar Karna
On Fri, Dec 19, 2008 at 6:38 AM, Yonih wrot
1. In your worksheet module add the following procedure
'if there is change in the Column-H mailPrice module will be called.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Intersect(Target, Range("H3:H80"))
If r Is Nothing Then Exit Sub
If r.Rows.Count >
You can copy paste the following procedure in the worksheet. In the VBA
editor (VBA project) double click the relevant sheet and paste the module
below.
'
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")).Rows.Count = 1 Th
In place of: ActiveCell.FormulaR1C1
use: ActiveCell.Formula
change other part of formula accordingly.
Akhilesh
On Fri, Nov 21, 2008 at 8:56 AM, Leigh Williams <[EMAIL PROTECTED]>wrote:
>
> I am trying to do a vlookup on my Excel spreadsheet using the
> following VBA code:
>
> Dim row As Inte
You can use the following macro.
Note: This macro will move all the data to column-A.
'
Sub moveTo1Col()
Dim i As Integer, j As Integer
i = 2
While Cells(1, i) <> ""
Cells(1, i).Select
Range(Selection, Selection.End(xlDown)).Se
One way to do this is use the following function.
'-
Function splitText(r As Range, s As String, col As Byte)
Dim txt As String
Dim c
txt = r.Value
c = Split(txt, s)
splitText = c(col - 1)
End Function
'-
It will be much easier if you attach the file itself. Your question is not
very clear to me.
Akhilesh
On Fri, Nov 7, 2008 at 4:16 PM, <[EMAIL PROTECTED]> wrote:
>
> I want to use excel to schedule services on trucks.
> Individual trucks can have services of 6 weeks, 8 weeks or 10 weeks
> apart
Hi,
Your purpose can be achieved by minor improvement in your code. You can
replace the following part of first macro.
With Workbooks(sCurFile)
>.Worksheets(2).PrintOut
>.Worksheets(3).PrintOut
>.Close SaveChanges:=False
>End
Hi,
Probably you cannot find any proper formula for your problem. Following
function may help you.
[tools->Macro->visual basic editor] will get you to macro editor
[insert-> module] and copy paste the following function.
You need to see how the function is used as formula in the attached file.
'--
Your question is not quite clear. Make it more understandable.
Akhilesh
On Thu, Oct 30, 2008 at 8:28 AM, Amanda <[EMAIL PROTECTED]> wrote:
>
> I have a spreadsheet I would like to upload with the column in
> question - how do I upload it?
>
>
>
--~--~-~--~~~---~--~--
You can run the following macro assuming that your texts are in column-A. If
it differs, change the program accordingly. Hope it helps.
Option Explicit
'-
Sub txt2arr()
'Assuming that all the texts are in column-A
'This program will fill the subsequent c
Hello,
My idea is as follows. (Someone may come with better ideas.)
Assuming that you have names in column-A and dates in column-B;
1. First of all create the function (after the instructions) in your VBA
module. Maybe copy-pasted.
2. In cell C2 you can write following formula against the dates
"=d
You can use the following function as a solution. There might be better
ones.
1. Open VBA editor ; Insert a module and then copy-paste the following code.
'-
Option Explicit
Function lastWord(r As Range, sWord As String)
Dim i As Integer, j
At the start of the program use the following code
-
Application.screenupdating=false
-
before terminating the program, repeat the above code with 'true' on the
right hand side.
Akhilesh
On Thu, Sep 11, 2008 at 11:45 PM, Lawrence <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> At the moment I am
Hi,
I think you can use the following VBA macro.
'-
Sub findVar()
Dim i As Byte, n As Byte
Dim findVar
n = ActiveWorkbook.Sheets.Count
Dim var_no As String
Dim sh As String 'sheet name where first occurrence is found
var_no = Sheets(
Hi,
It is good to start programming from the starting point. In most of the
programing languages you need to declare variables before writing the codes.
In VBA (Excel Macros) 'Dim' is the keyword for declaration of the variables.
It is good habit to declare variables in VBA if you want to be a goo
You can use the following macro if your filenames are really as you said.
Further you need to change the path to the file. You need to check the name
of sheet also. Hope it helps.
'-
Sub combineWorkbooks
Dim i As Integer
Dim j As Integer
Dim w1 As
Hi,
I think you should use "F8" button to see what happens at each step.
Akhilesh
On Tue, Sep 2, 2008 at 10:50 PM, c-class <[EMAIL PROTECTED]>wrote:
>
> Hello,
>
> I have the following problem:
>
>Workbooks(datei).Sheets(land).Activate
>
>Range("A1:Z176").Copy
>
>
I can do this. But, I think you should do your homework by yourself. Please
try to do once, if you can't then ask for help.
Akhilesh
On Sun, Aug 31, 2008 at 7:57 AM, <[EMAIL PROTECTED]> wrote:
>
> Y values - I have y-values in 2 rows of my spreadsheet, say A5:W5 and
> A10:W10.
>
> X values - The
39 matches
Mail list logo